From 704bbeb05ed1e55a225fc324a5fefcf598ba1476 Mon Sep 17 00:00:00 2001
From: Erik Bystrm <erik.bystrom@gmail.com>
Date: Sun, 15 Jan 2006 11:59:43 +0100
Subject: [PATCH] use usleep in locking to avoid 100% CPU

darcs-hash:20060115105943-4b825-c15733992e9bbf26621d4431da3171bcb8d24057.gz
---
 lib/exe/indexer.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index c07c33408..49b532507 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -50,6 +50,7 @@ function runIndexer(){
     // try to aquire a lock
     $lock = $conf['lockdir'].'/_indexer.lock';
     while(!@mkdir($lock,0777)){
+        usleep(50);
         if(time()-@filemtime($lock) > 60*5){
             // looks like a stale lock - remove it
             @rmdir($lock);
-- 
GitLab