• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/handlers/table/usersessiontable.php
  • Класс: BitrixMainSessionHandlersTableUserSessionTable
  • Вызов: UserSessionTable::lock
static function lock($id, $timeout = 60)
{
	$result = true;

	$pool = Application::getInstance()->getConnectionPool();
	$pool->useMasterOnly(true);

	$connection = static::getEntity()->getConnection();
	if ($connection instanceof MysqlCommonConnection)
	{
		$result = $connection->lock($id, (int)$timeout);
	}
	else
	{
		trigger_error(sprintf('SessionTable::lock not supported for connection of type "%s"', get_class($connection)), E_USER_WARNING);
	}

	$pool->useMasterOnly(false);

	return $result;
}