note 47842 deleted from function.flock by danbrown

From: Date: Mon, 18 May 2009 00:43:36 +0000
Subject: note 47842 deleted from function.flock by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155421@lists.php.net to get a copy of this message
Note Submitter: mic at mymail dot bz ---- 2 rehfeld.us in your code <?php ... $timeStart = microtime_float(); do { if ((microtime_float() - $timeStart) > $timeLimit) break; $locked = @mkdir($lockDir); } while ($locked === false); ... ?> $timeStart and return value of microtime_float() is _float_, i.e. for example $timestart = 1101991367.393253 and microtime_float() - $timeStart will be like 0.00123 but $timeLimit is _integer_ and much bigger So code will work but execution timeout ocured. you must set value of $timeLimit in float, i.e. $timeLimit = 0.03

« previous php.notes (#155421) next »