Release the lock.
770820
def release(self):
        """"""
        #  This decrements the appropriate lock counters, and if the lock
        #  becomes free, it looks for a queued thread to hand it off to.
        #  By doing the handoff here we ensure fairness.
        me = currentThread()
        with self._lock:
            if self.is_exclusive:
                if self._exclusive_owner is not me:
                    raise RuntimeError("release() called on unheld lock")
                self.is_exclusive -= 1
                if not self.is_exclusive:
                    self._exclusive_owner = None
                    #  If there are waiting shared locks, issue it to them
                    #  all and then wake everyone up.
                    if self._shared_queue:
                        for (thread,waiter) in self._shared_queue:
                            self.is_shared += 1
                            self._shared_owners[thread] = 1
                            waiter.notify()
                        del self._shared_queue[:]
                    #  Otherwise, if there are waiting exclusive locks,
                    #  they get first dibbs on the lock.
                    elif self._exclusive_queue:
                        (thread,waiter) = self._exclusive_queue.pop(0)
                        self._exclusive_owner = thread
                        self.is_exclusive += 1
                        waiter.notify()
            elif self.is_shared:
                try:
                    self._shared_owners[me] -= 1
                    if self._shared_owners[me] == 0:
                        del self._shared_owners[me]
                except KeyError:
                    raise RuntimeError("release() called on unheld lock")
                self.is_shared -= 1
                if not self.is_shared:
                    #  If there are waiting exclusive locks,
                    #  they get first dibbs on the lock.
                    if self._exclusive_queue:
                        (thread,waiter) = self._exclusive_queue.pop(0)
                        self._exclusive_owner = thread
                        self.is_exclusive += 1
                        waiter.notify()
                    else:
                        assert not self._shared_queue
            else:
                raise RuntimeError("release() called on unheld lock")
989328
public static function release()
	{
		if ( is_null( self::$authFileP ) ) return;
		$a = @flock( self::$authFileP , LOCK_UN );
		@fclose( self::$authFileP );
		self::$authFileP       = null;
		self::$currentlylocked = false;
	}
385482
def release(self):
        ""
        if self._waiters:
            scheduler.state.awoken_from_events.add(self._waiters.popleft())
        else:
            self._value += 1
1176377
def release_lock(self, force=False):
        
        if self.readonly:
            raise exc.ReadOnlyDatabase()
        if self._locked or force:
            self.log.debug("Removing lock file: {0}".format(self.lockfile))
            if os.path.exists(self.lockfile):
                os.remove(self.lockfile)
                self._locked = False
        else:
            self.log.debug("Database not locked (not removing)")
621514
public function release()
    {
        try {
            $this->lock->release();
        } catch (\Exception $ex) {
            throw new \RuntimeException(
                sprintf(
                    'Releasing the lock failed with the following message: %s',
                    $ex->getMessage()
                ),
                0,
                $ex
            );
        }
    }
1104035
def close(self):
        
        with self._close_lock:
            epfd = self._epfd
            if epfd >= 0:
                self._epfd = -1
                close(epfd)
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.');
            }
        }
    }
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
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
719595
final void release(){
		try {stopCapture();}
		catch (StateException se) {
			//capture already stopped 
		}

		state.release();		
		doRelease(object);
		state.commit();
	}
443067
def release(self, conn):
        """"""
        self._pool_lock.acquire()
        self._pool.put(ConnectionWrapper(self._pool, conn))
        self._current_acquired -= 1
        self._pool_lock.release()
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);
        }
    }
1306578
public void unlock() throws IOException {
    if (fileLock != null) {
      try {
        fileLock.release();
      } catch (ClosedChannelException e) {
      }
      fileLock = null;
    }
  }
1003118
void releaseInternal(FileLock lock, FileChannel channel) {
        try {
            lock.release();
            channel.close();
        } catch (IOException e) {
            logger.severe("Problem while releasing the lock and closing channel on " + lockFile, e);
        } finally {
            lockFile.deleteOnExit();
        }
    }
445965
public function release()
    {
        $this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner);
    }
775732
public void release()
    {
        super.release();

        _forceId = null;
        _forceIdIndex = null;

        _value = null;
        _converter = null;

        _javascriptLocation = null;
        _imageLocation = null;
        _styleLocation = null;
    }
497970
public void unlock() {
		ArrayList<Runnable> list;
		Thread t = Thread.currentThread();
		synchronized (this) {
			if (t != lockingThread) return;
			if (--lockedTimes > 0) return;
			lockingThread = null;
			list = listeners;
			listeners = null;
		}
		if (list != null) {
			for (Runnable r : list) r.run();
		}
		// notify after listeners
		synchronized (this) {
			this.notifyAll();
		}
	}