MatthiasMullie\Scrapbook\Adapters\Flysystem::lock PHP Метод

lock() защищенный Метод

It'll try to get a lock for a couple of times, but ultimately give up if no lock can be obtained in a reasonable time.
protected lock ( string $key ) : boolean
$key string
Результат boolean
    protected function lock($key)
    {
        $path = $key . '.lock';
        for ($i = 0; $i < 25; ++$i) {
            try {
                $this->filesystem->write($path, '');
                return true;
            } catch (FileExistsException $e) {
                usleep(200);
            }
        }
        return false;
    }