Lines Matching defs:lock
37 if (!$this->lock())
178 if (!$this->lock())
276 if (!$this->lock()) return 'locked';
322 if (!$this->lock()) return 'locked';
382 if (!$this->lock())
460 if (!$this->lock()) return false;
554 if (!$this->lock())
944 protected function lock()
949 $lock = $conf['lockdir'] . '/_indexer.lock';
950 while (!@mkdir($lock)) {
952 if (is_dir($lock) && time() - @filemtime($lock) > 60 * 5) {
953 // looks like a stale lock - remove it
954 if (!@rmdir($lock)) {
955 $status = "removing the stale lock failed";
958 $status = "stale lock removed";
961 // we waited 5 seconds for that lock
966 chmod($lock, $conf['dperm']);
972 * Release the indexer lock.
981 @rmdir($conf['lockdir'] . '/_indexer.lock');