WINCACHE_UNLOCK(3) 1 WINCACHE_UNLOCK(3)
wincache_unlock - Releases an exclusive lock on a given key
SYNOPSIS
bool wincache_unlock (string $key)
DESCRIPTION
Releases an exclusive lock that was obtained on a given key by using wincache_lock(3). If any other process was blocked waiting for the
lock on this key, that process will be able to obtain the lock.
Warning
Using of the wincache_lock(3) and wincache_unlock(3) can cause deadlocks when executing PHP scripts in a multi-process environment
like FastCGI. Do not use these functions unless you are absolutely sure you need to use them. For the majority of the operations on
the user cache it is not necessary to use these functions.
PARAMETERS
o $key
- Name of the key in the cache to release the lock on.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using wincache_unlock(3)
<?php
$fp = fopen("/tmp/lock.txt", "r+");
if (wincache_lock("lock_txt_lock")) { // do an exclusive lock
ftruncate($fp, 0); // truncate file
fwrite($fp, "Write something here
");
wincache_unlock("lock_txt_lock"); // release the lock
} else {
echo "Couldn't get the lock!";
}
fclose($fp);
?>
SEE ALSO
wincache_lock(3), wincache_ucache_set(3), wincache_ucache_get(3), wincache_ucache_delete(3), wincache_ucache_clear(3), win-
cache_ucache_exists(3), wincache_ucache_meminfo(3), wincache_ucache_info(3), wincache_scache_info(3).
PHP Documentation Group WINCACHE_UNLOCK(3)