syncPHP的同步函数调用实现与应用
PHP同步
// Call a function in a mutually exclusive way using a lockfile.
// A process will only block other processes and never block itself,
// so you can safely nest synchronized operations.
Sync::call(function () {
// do critical stuff like IO here
});
// Set default lockfile
Sync::$lock = 'my/default/.lock';
// Use different lockfile by passing it as the second argument
Sync::
下载地址
用户评论