malkusch\lock\mutex\LockMutex::synchronized PHP Method

synchronized() public method

public synchronized ( callable $code )
$code callable
    public function synchronized(callable $code)
    {
        $this->lock();
        try {
            return call_user_func($code);
        } finally {
            $this->unlock();
        }
    }