• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/data/cacheengine.php
  • Класс: BitrixMainDataCacheEngine
  • Вызов: CacheEngine::lock
protected function lock(string $key = '', int $ttl = 0) : bool
{
	if ($key == '')
	{
		return false;
	}

	$key .= '~';
	if (isset(self::$locks[$key]))
	{
		return true;
	}
	else
	{
		if ($this->setNotExists($key, $ttl, $this->ttlOld))
		{
			self::$locks[$key] = true;
			return true;
		}
	}

	return false;
}