You are here

public static function UltimateCronLock::unlock in Ultimate Cron 7.2

Release lock.

Parameters

string $lock_id: The lock id to release.

1 call to UltimateCronLock::unlock()
UltimateCronLock::shutdown in ./ultimate_cron.lock.inc
Shutdown handler for releasing locks.

File

./ultimate_cron.lock.inc, line 115
A database-mediated implementation of a locking mechanism.

Class

UltimateCronLock
Class for handling lock functions.

Code

public static function unlock($lock_id) {
  $target = _ultimate_cron_get_transactional_safe_connection();
  $unlocked = db_update('ultimate_cron_lock', array(
    'target' => $target,
  ))
    ->expression('current', 'lid')
    ->condition('lid', $lock_id)
    ->condition('current', 0)
    ->execute();
  self::persist($lock_id);
  return $unlocked;
}