if (null !==
$this->lock
) { throw new LogicException('A lock is already in place.'
);
} if (SemaphoreStore::
isSupported()) { $store =
new SemaphoreStore();
} else { $store =
new FlockStore();
} $this->lock =
(new LockFactory($store))->
createLock($name ?:
$this->
getName());
if (!
$this->lock->
acquire($blocking)) { $this->lock = null;
return false;
} return true;
} /**
* Releases the command lock if there is one.
*/