=')) { self::$semaphore[$key] = sem_get(self::semaphoreKey($key)); if (self::$semaphore[$key]) { return sem_acquire(self::$semaphore[$key], ($timeout == 0)); } } } /** * @brief Removes a lock if it was set by us * * @param string $key Name of the lock * * @return mixed */ public function releaseLock($key) { if (function_exists('sem_get') && version_compare(PHP_VERSION, '5.6.1', '>=')) { if (empty(self::$semaphore[$key])) { return false; } else { $success = @sem_release(self::$semaphore[$key]); unset(self::$semaphore[$key]); return $success; } } } /** * @brief Removes all lock that were set by us * * @return void */ public function releaseAll() { // not needed/supported return; } }