mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user