update to 2.2.5 version again

add transaction for SpinLock.php
add getAllCQ() for CQ.php
fix CQ bug
update docs
This commit is contained in:
jerry
2021-02-20 16:57:19 +08:00
parent f677b0e132
commit 9ace85e604
9 changed files with 462 additions and 53 deletions

View File

@@ -39,4 +39,10 @@ class SpinLock
public static function unlock(string $key) {
return self::$kv_lock->set($key, ['lock_num' => 0]);
}
public static function transaction(string $key, callable $function) {
SpinLock::lock($key);
$function();
SpinLock::unlock($key);
}
}