public function merge($key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0) { if (wincache_lock($key)) { // optimize with FIFO lock $ok = $this->mergeViaLock($key, $callback, $exptime, $attempts, $flags); wincache_unlock($key); } else { $ok = false; } return $ok; }
/** * Releases a named lock. * * @param string $key Name of the key to release. Note that $key may * repeat for each distinct $persistentId. * * @return bool TRUE on success, FALSE on failure. */ public function unlock($key) { $result = wincache_unlock($this->persistentId . static::encodeLockName($key)); if ($result) { unset(static::$locksBackup[$this->persistentId][array_search($key, static::$locksBackup[$this->persistentId], true)]); } return $result; }