+
95
-

swoole的内存锁怎么用?

php

请问swoole的内存锁怎么用?

网友回复

+
15
-
$lock = new swoole_lock(SWOOLE_MUTEX);
echo "[Master]create lock\n";
$lock->lock();
if(pcntl_fork() > 0) 
{
        sleep(1);
        $lock->unlock();
} 
el...

点击查看剩余70%

我知道答案,我要回答