Merge pull request #3554 from Alkarex/semaphore_warning

Hide semaphore warning
This commit is contained in:
Michael Vogel 2017-07-08 18:32:07 +02:00 committed by GitHub
commit 8863f0e234

View file

@ -156,9 +156,14 @@ class Lock {
* @param string $fn_name Name of the lock * @param string $fn_name Name of the lock
*/ */
public static function remove($fn_name) { public static function remove($fn_name) {
if (function_exists('sem_get') && self::$semaphore[$fn_name]) { if (function_exists('sem_get')) {
sem_release(self::$semaphore[$fn_name]); if (empty(self::$semaphore[$fn_name])) {
return; return false;
} else {
$success = @sem_release(self::$semaphore[$fn_name]);
unset(self::$semaphore[$fn_name]);
return $success;
}
} }
$memcache = self::connectMemcache(); $memcache = self::connectMemcache();