Releases the lock

@return boolean true on success, false otherwise
2206
public function release(): bool
    {
        $success = true;
        if (is_resource($this->filePointer)) {
            // FIXME: The lockfile should be unlocked at this point but this will again lead to race conditions,
            // so we need to find out how to do this in a safe way. Keeping the lock files is very inode intensive
            // and should therefore change ASAP.
            if (flock($this->filePointer, LOCK_UN) === false) {
                $success = false;
            }
            fclose($this->filePointer);
        }

        return $success;
    }
315985
def release_lock():
    """"""
    get_lock.n_lock -= 1
    assert get_lock.n_lock >= 0
    # Only really release lock once all lock requests have ended.
    if get_lock.lock_is_enabled and get_lock.n_lock == 0:
        get_lock.start_time = None
        get_lock.unlocker.unlock()
106753
public function lock()
    {
        if ($this->handle) {
            return true;
        }

        // start the silence for both userland and native PHP error handlers
        $errorLevel = error_reporting(0);
        set_error_handler('var_dump', 0);

        if (!$this->handle = fopen($this->file, 'r')) {
            if ($this->handle = fopen($this->file, 'x')) {
                chmod($this->file, 0444);
            } elseif (!$this->handle = fopen($this->file, 'r')) {
                usleep(100);
                $this->handle = fopen($this->file, 'r');
            }
        }

        restore_error_handler();
        error_reporting($errorLevel);

        if (!$this->handle) {
            $error = error_get_last();
            throw new \RuntimeException($error['message'], 0, null, $this->file);
        }

        if (!flock($this->handle, LOCK_EX | LOCK_NB)) {
            fclose($this->handle);
            $this->handle = null;

            return false;
        }

        return true;
    }
1304553
def release(self):
        
        
        if self.is_locked_by_me():
            os.remove(self.lock_filename)
            logger.debug('The lock {} is released by me (pid: {}).'.format(self.lock_filename, self.pid))
        if self.fd:
            os.close(self.fd)
            self.fd = None
595077
async def release(self):
        ""
        expected_token = self.local.token
        if expected_token is None:
            raise LockError("Cannot release an unlocked lock")
        self.local.token = None
        await self.do_release(expected_token)
1269977
public function release($key)
    {
        if ($this->cache->remove($key)) {
            if (($index = array_search($key, $this->keys)) !== false) {
                unset($this->keys[$index]);
            }
            return true;
        } else {
            return false;
        }
    }
1250685
private function release()
    {
        \assert($this->busy !== null);

        $deferred = $this->busy;
        $this->busy = null;
        $deferred->resolve();
    }
430448
public function release() {
        if ($this->isAquired()) {
            $hFile = self::$hFiles[$this->filename];
            if (!flock($hFile, LOCK_UN)) throw new RuntimeException('Can not release lock on file "'.$this->filename.'"');
            unset(self::$hFiles[$this->filename]);
            fclose($hFile);
        }
    }
1195114
public function release()
    {
        if ($this->semaphoreId) {
            $released = sem_release($this->semaphoreId);
            $this->semaphoreId = null;

            if (!$released) {
                throw new \RuntimeException('Failed to release lock.');
            }
        }
    }
1040946
public function release()
    {
        if ($this->handle) {
            $released = flock($this->handle, LOCK_UN);
            fclose($this->handle);
            $this->handle = null;

            if (!$released) {
                throw new \RuntimeException('Failed to release lock.');
            }
        }
    }
539382
protected function lock() {

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

        return true;
    }
187617
public function close()
    {
        if (!$this->freed) {
            $this->freed = true;
            if (isset($this->bev)) {
                $this->bev->free();
            }
            $this->bev = null;
            //$this->eventLoop->interrupt();
        }
        if ($this->pool) {
            $this->pool->detach($this);
        }
    }
629682
public function unlock(): bool
    {
        if (!$this->handle) {
            return false;
        }

        if ($this->locked) {
            flock($this->handle, LOCK_UN);
            $this->locked = false;
        }

        fclose($this->handle);
        $this->handle = null;

        return true;
    }
813190
public function close()
    {
        if ($this->closed) {
            return false;
        }
        $this->closed = true;
        if ($this->fdCacheKey !== null) {
            FileSystem::$fdCache->invalidate($this->fdCacheKey);
        }
        if ($this->fd === null) {
            return false;
        }

        if (!FileSystem::$supported) {
            fclose($this->fd);
            return false;
        }
        $r = eio_close($this->fd, EIO_PRI_MAX);
        $this->fd = null;
        return $r;
    }
951881
public function handler_close() {
        if ($this->recordid) {
            try {
                $this->database->release_session_lock($this->recordid);
            } catch (\Exception $ex) {
                // Ignore any problems.
            }
        }
        $this->recordid = null;
        $this->lasthash = null;
        return true;
    }
376362
public function release() {
        $this->released = true;
        if (empty($this->factory)) {
            return false;
        }
        $result = $this->factory->release_lock($this);
        // Release any held references to the factory.
        unset($this->factory);
        $this->factory = null;
        $this->key = '';
        return $result;
    }
303363
protected function unlock()
    {
        if (null !== $this->lockKey) {
            $this->client->del($this->lockKey);
            $this->lockKey = null;
        }
    }