Example #1
0
 /**
  * Acquires a lock on the item table
  *
  * @return bool	True if the lock was acquired, false if it has been acquired previously
  *
  * @throws \RuntimeException If the lock could not be acquired
  */
 protected function acquire_lock()
 {
     if ($this->lock->owns_lock()) {
         return false;
     }
     if (!$this->lock->acquire()) {
         throw new \RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
     }
     return true;
 }