Unlocks synchronized variable, making it available for
all processes that uses it. Note that any app using a
shared object can unlock it.

@access public
@return self
430881
public function unlock()
    {
        $this->storage->openWriter();
        $object = $this->getObjectSafely('openWriter');
        $object->setLocked(false);
        $this->lock = false;
        $this->storage->setObject($object);
        $this->storage->close();
        return $this;
    }
640537
public function coroutineTrylock()
    {
        $result = $this->redis_pool->getCoroutine()->setnx(self::LOCK_PREFIX . $this->lock_id, 1);
        return $result;
    }
608735
private function acquireLock()
    {
        if (file_exists($this->lockFile)) {
            $stale_after = filemtime($this->lockFile) + $this->maxLockAge;
            if (time() > $stale_after) {
                // The lockfile is stale, delete it and reacquire a lock
                @rmdir($this->lockFile);
            } else {
                // The lockfile is valid, WURFL is probably being reloaded in another thread
                return false;
            }
        }
        
        // Using mkdir instead of touch since mkdir is atomic
        $this->isLocked = @mkdir($this->lockFile, 0775);
        return $this->isLocked;
    }
486293
public function unlock()
    {
        $this->shouldLock = false;

        if (!$handle = $this->resource()) {
            return false;
        }

        return $this->applyLock($handle);
    }
1030405
public function unlock () {
        if (!$this->beforeUnlock ()) {
            return false;
        }
        $redis = $this->getConnection ()->getClient ();
        $value = $redis->get ($this->name);
        $decimalPlaces = max (strlen (substr ($value , strpos ($value , "."))) , strlen (substr ($this->_expiresAt , strpos ($this->_expiresAt , ".")))) - 1;
        if (bccomp ($value , $this->_expiresAt , $decimalPlaces) == -1 && bccomp ($value , microtime (true) , $decimalPlaces) == 1) {
            return false;
        }


        $redis->delete ($this->name);
        $this->afterUnlock ();
        return true;
    }
938603
public function release()
    {
        if (!$this->locked) {
            throw new \RuntimeException('release a non lock');
        }

        $unlock = flock($this->fp, LOCK_UN);
        fclose($this->fp);
        if ($unlock !== true) {
            return false;
        }
        $this->locked = false;

        return true;
    }
893545
public function finish()
    {
        // Re-sync before shutting down.
        foreach ($this->drivers as $acl) {
            $acl->sync();
        }

        $this->drivers = [];

        return $this;
    }
247007
public function unlock()
    {
        return PoolManager::use($this->poolName, function($resource, $redis){
            return 1 == $redis->evalEx(<<<SCRIPT
local key     = KEYS[1]
local content = KEYS[2]
local db      = ARGV[1]
redis.call('select', db)
local value = redis.call('get', key)
if value == content then
  return redis.call('del', key);
end
return 0
SCRIPT
            , [
                $this->key,
                $this->guid,
                $this->db,
            ], 2);
        });
    }
456782
public function unlock()
    {
        $this->count--;

        if ($this->count < 0) {
            $this->count = 0;
            return false;
        }

        if (0 === $this->count) {
            $this->entityManager->flush();

            return true;
        }

        return false;
    }
262282
public function isOverlapping()
    {
        return $this->lockFile &&
            file_exists($this->lockFile) &&
            call_user_func($this->whenOverlapping, filemtime($this->lockFile)) === false;
    }
423805
protected static function lock()
    {
        $fd = fopen(static::$_startFile, 'r');
        if (!$fd || !flock($fd, LOCK_EX)) {
            static::log("Workerman[".static::$_startFile."] already running");
            exit;
        }
    }
539382
protected function lock() {

        $this->db->lockTable($this->getTable());
        $this->locked = true;

        return true;
    }
519832
function lock()
    {
        if ( $fp = $this->fp() )
        {
            if ( flock( $fp, LOCK_EX ) )
            {
                $this->clearMeta();
                $this->setMeta( 'timestamp', time() );
                return true;
            }
        }
        return false;
    }
676468
public function lock()
    {
        $this->_validate();
        $_SESSION[$this->secretStorage]['locks'][$this->_namespaceName] = true;
        return true;
    }
1358880
protected function _release_lock()
    {
        if (!$this->_lock) {
            return true;
        }
        if ($this->getConnection()->query("SELECT RELEASE_LOCK('".$this->_lock."') AS ci_session_lock")->row()->ci_session_lock) {
            $this->_lock = false;
            return true;
        }
        return false;
    }
1294289
public function release(): bool
    {
        if (!is_resource($this->lock)) {
            return true;
        }

        return flock($this->lock, LOCK_UN);
    }
72007
public function unlock()
    {
        $userid = $this->getObject('user')->getId();

        //Only an saved row can be unlocked by the user who locked it
        if(!$this->isNew() && $this->locked_by != 0 && $this->locked_by == $userid)
        {
            $this->locked_by = 0;
            $this->locked_on = 0;

            $this->save();
        }

        return true;
    }