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

synchronized() abstract public method

This method implements Java's synchronized semantic. I.e. this method waits until a lock could be acquired, executes the code exclusively and releases the lock. The code block may throw an exception. In this case the lock will be released as well.
abstract public synchronized ( callable $code ) : mixed
$code callable The synchronized execution block.
return mixed The return value of the execution block.
    public abstract function synchronized(callable $code);