NinjaMutex\Lock\DirectoryLock::getLock PHP 메소드

getLock() 보호된 메소드

protected getLock ( string $name, boolean $blocking ) : boolean
$name string
$blocking boolean
리턴 boolean
    protected function getLock($name, $blocking)
    {
        while (!@mkdir($this->getDirectoryPath($name))) {
            if (!$blocking) {
                return false;
            }
            usleep(rand(5000, 20000));
        }
        return true;
    }