getLockFactory(); $lock = $factory->createLock($actionId, $timeout); $lock->acquire(true); sleep($sleep); $lock->release(); /** * @return LockService */ function getInstance() { return ServiceManager::getServiceManager()->get(LockService::class); }