Release the lock.

        :return: Nothing
964960
def release(self):
        
        if self._lock_fd is not None:
            os.close(self._lock_fd)
            try:
                os.remove(self._lock_filename)
            except OSError:
                # Hmm, someone deleted our lock while we had it locked?
                # Nothing we can do, so just continue
                pass
866450
def release(self, forceRelease=False):
        '''
            
        '''
        if not self.held:
            if forceRelease is False:
                return False # We were not holding the lock
            else:
                self.held = True # If we have force release set, pretend like we held its
        
        if not os.path.exists(self.lockPath):
            self.held = False
            self.acquiredAt = None
            return True

        if forceRelease is False:
            # We waited too long and lost the lock
            if self.maxLockAge and time.time() > self.acquiredAt + self.maxLockAge:
                self.held = False
                self.acquiredAt = None
                return False

        self.acquiredAt = None

        try:
            os.rmdir(self.lockPath)
            self.held = False
            return True
        except:
            self.held = False
            return False
84171
def pop(self):
        
        stack = getattr(self._local, "stack", None)
        if stack is None:
            return None
        elif len(stack) == 1:
            release_local(self._local)
            return stack[-1]
        else:
            return stack.pop()
790231
private synchronized static void releaseWakeLock() {
        if (sWakeLock != null) {
            if (sWakeLock.isHeld()) {
                sWakeLock.release();

                // Clear static reference if the lock is no longer held after the release() call.
                if (!sWakeLock.isHeld()) {
                    sWakeLock = null;
                }
            } else {
                // The lock is not held, just clear the static reference.
                sWakeLock = null;
            }
        }

        sLogger.log(WingsService.class, "releaseWakeLock", "sWakeLock=" + sWakeLock);
    }
1239731
def _release_lock(lock_manager: ConsulLockManager, configuration: CliUnlockConfiguration):
    
    if configuration.regex_key_enabled:
        release_information = sorted(list(lock_manager.release_regex(key_regex=configuration.key)))
    else:
        release_information = lock_manager.release(key=configuration.key)
    print(json.dumps(release_information))

    exit(SUCCESS_EXIT_CODE)
83892
def __unLock(self):
        """"""
        self._operation = False
        self._timer = 0
        self._isLocked = False
31339
public void free()
    {
        // First, make sure there are no locks in any of the lock tables that I touched.
        SessionInfo session = new SessionInfo(0, null); // This will match any session with the same remote session ID
        session.m_iRemoteSessionID = this.getSessionID();
        Iterator<LockTable> iterator = m_hsMyLockTables.iterator();
        while (iterator.hasNext())
        {
            LockTable lockTable = iterator.next();
            lockTable.unlockAll(session);
            iterator.remove();
        }
        super.free();
    }
792673
def release(self, signal=True):
        
        if not self.needs_lock:
            return
        with self.synclock:
            self.lock.release()
            if signal:
                self.released_event(self)
            self.synclock.notify_all()
1219474
def lock(self):  # type: () -> Installer
        
        self.update()
        self.execute_operations(False)
        self._lock = True

        return self
257010
def close(self) -> None:
        
        if self.transport is not None and not self.transport.is_closing():
            self.transport.close()

        if self._connect_lock.locked():
            self._connect_lock.release()

        self.protocol = None
        self.transport = None
734624
def release_readlock(lockdir_name):
    
    # Make sure the lock still exists before deleting it
    if os.path.exists(lockdir_name) and os.path.isdir(lockdir_name):
        os.rmdir(lockdir_name)
661672
def unlock(self):
        
        if isinstance(self._session, manager.Manager):
            self._session.unlock()
1238888
def locked(self):
        
        conn = self._get_connection()
        try:
            self._lock(conn)
            yield conn
        finally:
            self._unlock(conn)
959297
def Release(self):
    
    if self.locked:
      query = ("UPDATE locks SET lock_expiration=0, lock_owner=0 "
               "WHERE lock_expiration=%s "
               "AND lock_owner=%s "
               "AND subject_hash=unhex(md5(%s))")
      args = [self.expires, self.lock_token, self.subject]
      self.store.ExecuteQuery(query, args)
      self.locked = False
238515
def release(self, key: str) -> Optional[str]:
        
        ConsulLockManager.validate_key(key)

        key_value = self.consul_client.kv.get(key)[1]
        if key_value is None:
            logger.info(f"No lock found")
            return None

        lock_information = json.loads(key_value["Value"].decode("utf-8"), cls=ConsulLockInformationJSONDecoder)
        logger.info(f"Destroying the session {lock_information.session_id} that is holding the lock")
        unlocked = self.consul_client.session.destroy(session_id=lock_information.session_id)
        # This instance might be managing the removed session
        try:
            self._acquiring_session_ids.remove(lock_information.session_id)
        except KeyError:
            pass

        logger.info("Unlocked" if unlocked else "Went to unlock but was already released upon sending request")
        return key
882844
def stop(self, timeout=None):
        
        with self._lock:
            if self._thread:
                self._queue.put_nowait(self._terminator)
                self._thread.join(timeout=timeout)
                self._thread = None
                self._thread_for_pid = None
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