• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/core/base/mutex.php
  • Класс: BitrixCalendarCoreBaseMutex
  • Вызов: Mutex::lock
public function lock(int $lockTime = 3600): bool
{
	$currentTime = time();
	if ($this->cache->read(1800, $this->name))
	{
		$value = $this->cache->get($this->name);
	}

	if (!empty($value) && $value > $currentTime)
	{
		return false;
	}

	$this->cache->setImmediate($this->name, $currentTime + $lockTime);
	return true;
}