Skip to content
Snippets Groups Projects
Commit 704bbeb0 authored by Erik Bystrm's avatar Erik Bystrm
Browse files

use usleep in locking to avoid 100% CPU

darcs-hash:20060115105943-4b825-c15733992e9bbf26621d4431da3171bcb8d24057.gz
parent 875f9efe
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment