/**
  * Release a named lock.
  * 
  * @param string $name 
  * @param bool $network_wide 
  * @return bool
  */
 function release($name, $network_wide = false)
 {
     global $wpdb;
     if (!$network_wide) {
         $name = WPMutex::_get_private_name($name);
     }
     $released = $wpdb->get_var($wpdb->prepare('SELECT RELEASE_LOCK(%s)', $name));
     return $released == 1;
 }
Ejemplo n.º 2
0
 /**
  * Relese our exclusive lock. 
  * Does nothing if the lock has already been released.
  *
  * @return bool
  */
 function release_lock()
 {
     return WPMutex::release('blc_lock');
 }