Releases the advisory lock.

@param int $operation

@return bool

@see FlysystemStreamWrapper::stream_lock()
13313
protected function releaseLock($operation)
    {
        $exists = is_resource($this->lockHandle);

        $success = $exists && flock($this->lockHandle, $operation);

        $exists && fclose($this->lockHandle);
        $this->lockHandle = null;

        return $success;
    }
437310
private static function lock()
	{
		if (self::$currentlylocked === false) {
			self::$authFileP = fopen( self::$authFile , "a+" );
			if ( flock( self::$authFileP , LOCK_EX ) ) {
				self::$currentlylocked = true;
			} else {
				throw new Exception( 'Unable to lock file' );
			}
		}

		return true;
	}
46413
protected function hasHooks($operation)
    {
        return $this->enableHooks &&
            is_subclass_of($this->class, Hookable::class) &&
            (method_exists($this->class, "before$operation") || method_exists($this->class, "after$operation"));
    }
1128386
public function actionMigrate($operation = 'up')
    {
        if ($this->confirm("Migrate {$operation} migration: " . $this->migration)) {
            $migration = Yii::createObject($this->migration);
            $migration->{$operation}();
        } else {
            $this->stdout('User abort.' . PHP_EOL, Console::FG_YELLOW);
        }
        return 0;
    }
685559
public function close()
    {
        if ($this->stream === null) {
            return;
        }
        if (false === @fclose($this->stream)) {
            // FAILED.
            $msg = "Cannot fclose " . $this->__toString() . " $php_errormsg";
            throw new IOException($msg);
        }
        $this->stream = null;
    }
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;
    }
922764
public function stream_close() {
    assert(isset($this->client));
    $this->client->close();
    $this->client = null;
  }
1082185
public function unlock()
    {
        if ($this->fp !== null) {
            flock($this->fp, LOCK_UN);
            fclose($this->fp);
            $this->fp = null;
        }

        return true;
    }
1305633
public function stream_close()
    {
        $this->_objectName = null;
        $this->_objectBuffer = null;
        $this->_objectSize = 0;
        $this->_position = 0;
        $this->_writeBuffer = false;
        unset($this->_oss);
    }
145956
public function release( $job ) {
		$data  = array(
			'job'         => serialize( $job ),
			'attempts'    => $job->attempts(),
			'reserved_at' => null,
		);
		$where = array(
			'id' => $job->id(),
		);

		if ( $this->database->update( $this->jobs_table, $data, $where ) ) {
			return true;
		}

		return false;
	}
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;
    }
64221
public function unlock(): bool
    {
        $result = false;

        if ($this->locker->releaseLock()) {
            $result = true;
        }

        return $result;
    }
655301
protected function setOperation($query, string $operation)
	{
		if(($query instanceof Subquery) === false)
		{
			$query = new Subquery($query);
		}

		$this->setOperations[] =
		[
			'query'     => $query,
			'operation' => $operation,
		];

		return $this;
	}
74037
function close()
    {
        $this->flush();
        $this->_opened = false;
        if ($this->_closeResource === true && is_resource($this->_stream)) {
            fclose($this->_stream);
        }
        return true;
    }
497160
protected function doCall($operation)
    {
        $this->client->send($operation);
        $result = $this->client->recv();
        if(false === $result)
        {
            return false;
        }
        if(null === $result->throwable)
        {
            return $result->result;
        }
        else
        {
            throw $result->throwable;
        }
    }
701894
public function release()
    {
        if (!$this->locked) {
            throw new \RuntimeException("release a non lock");
        }

        if (!sem_release($this->lock_id)) {
            return false;
        }
        $this->locked = false;

        return true;
    }
468917
public function release_lock(lock $lock) {
        $params = array('locktype' => $this->dblockid,
                        'token' => $lock->get_key());
        $result = $this->db->get_record_sql('SELECT pg_advisory_unlock(:locktype, :token) AS unlocked', $params);
        $result = $result->unlocked === 't';
        if ($result) {
            unset($this->openlocks[$lock->get_key()]);
        }
        return $result;
    }