• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/posting/sender.php
  • Класс: BitrixSenderPostingSender
  • Вызов: Sender::unlock
static function unlock($id, $threadId = 0)
{
	$id       = intval($id);
	$threadId = intval($threadId);

	$connection = Application::getInstance()->getConnection();
	if ($connection instanceof DBMysqlCommonConnection)
	{
		$uniqueSalt = self::getLockUniqueSalt(false);
		if (!$uniqueSalt)
		{
			return false;
		}

		$lockDb = $connection->query(
			sprintf(
				"SELECT RELEASE_LOCK('%s_sendpost_%d_%d') as L",
				$uniqueSalt,
				$id,
				$threadId
			)
		);
		$lock   = $lockDb->fetch();
		if ($lock["L"] == "0")
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	return false;
}