From 704bbeb05ed1e55a225fc324a5fefcf598ba1476 Mon Sep 17 00:00:00 2001 From: Erik Bystrm Date: Sun, 15 Jan 2006 11:59:43 +0100 Subject: use usleep in locking to avoid 100% CPU darcs-hash:20060115105943-4b825-c15733992e9bbf26621d4431da3171bcb8d24057.gz --- lib/exe/indexer.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/exe/indexer.php') 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); -- cgit v1.2.3