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

	$uniqueSalt = self::getLockUniqueSalt();
	$connection = Application::getInstance()->getConnection();
	if ($connection instanceof DBMysqlCommonConnection)
	{
		$lockDb = $connection->query(
			sprintf(
				"SELECT GET_LOCK('%s_sendpost_%d_%d', 0) as L",
				$uniqueSalt,
				$id,
				$threadId
			),
			false,
			"File: ".__FILE__."
Line: ".__LINE__ ); $lock = $lockDb->fetch(); if ($lock["L"] == "1") { return true; } else { return false; } } return false; }