Releases an object of type T, this must be called after the thread is done using a resource
obtained by acquire.

@param resource the resource to be released, it should not be reused after calling this method
485067
@Override
  public void release(T resource) {
    if (resource != null) {
      mResources.add(resource);
      try (LockResource r = new LockResource(mTakeLock)) {
        mNotEmpty.signal();
      }
    }
  }
236196
public void removeCssResource(final ApplicationResource resource) {
		WApplicationModel model = getOrCreateComponentModel();
		if (model.cssResources != null) {
			model.cssResources.remove(resource);
		}
	}
1266450
public void release() {
	this.base = null;
	current = root;
	current.body = null;
	current.after = null;
	current.before = null;
    }
339947
public void release() {
        try {
            if(hasCoreConnection()) {
                checkThreadBinding();
                this.setClosed(true);
                this.getCoreConnection().reset();
                this.fireConnectionReleased();

            }
        } finally {
            this.setClosed(true);

            // state may be important for Stat-Listener, so its set after the listener did their work
            setTransactionalData(false);

            this.releaseThreadBinding();
        }
    }
1154461
private void remove(Thread t) {
        synchronized (this) {
            if (destroyed) {
                return;
            }
            for (int i = 0 ; i < nthreads ; i++) {
                if (threads[i] == t) {
                    System.arraycopy(threads, i + 1, threads, i, --nthreads - i);
                    // Zap dangling reference to the dead thread so that
                    // the garbage collector will collect it.
                    threads[nthreads] = null;
                    break;
                }
            }
        }
    }
574093
public void release(Contextual<T> contextual, T instance) {
        synchronized (dependentInstances) {
            for (ContextualInstance<?> dependentInstance : dependentInstances) {
                // do not destroy contextual again, since it's just being destroyed
                if (contextual == null || !(dependentInstance.getContextual().equals(contextual))) {
                    destroy(dependentInstance);
                }
            }
        }
        if (resourceReferences != null) {
            for (ResourceReference<?> reference : resourceReferences) {
                reference.release();
            }
        }
    }
1075263
public final void release() {
		synchronized (this.LOCK) {
			if ((this.owner != null)
					&& (this.owner.get() == Thread.currentThread())) {
				this.acquire--;

				if (this.acquire == 0) {
					this.owner = null;
					this.LOCK.notify();
				}

				return;
			}

			if ((this.owner != null) && (this.owner.get() == null)) {
				this.owner = null;
				this.acquire = 0;
				this.LOCK.notify();
			}

			throw new IllegalMonitorStateException(Thread.currentThread()
					.getName()
					+ " is not the owner of the lock. "
					+ ((this.owner != null) ? ((Thread) this.owner.get())
							.getName() : "nobody") + " is the owner.");
		}
	}
525473
protected void closeConnection(ThriftConnectionHandle<T> connection) {
		if (connection != null) {
			try {
				connection.internalClose();
			} catch (Throwable t) {
				logger.error("Destroy connection exception", t);
			} finally {
				this.thriftConnectionPool.postDestroyConnection(connection);
			}
		}
	}
1153281
@Override
    public synchronized void release() throws Exception
    {
        Exception       baseException = null;

        for ( InterProcessLock lock : reverse(locks) )
        {
            try
            {
                lock.release();
            }
            catch ( Exception e )
            {
                ThreadUtils.checkInterrupted(e);
                if ( baseException == null )
                {
                    baseException = e;
                }
                else
                {
                    baseException = new Exception(baseException);
                }
            }
        }

        if ( baseException != null )
        {
            throw baseException;
        }
    }
289353
public static TaskManager unregisterResource(Object resource) {
		if (resource == null) return null;
		synchronized (resources) {
			return resources.remove(resource);
		}
	}
1131798
void releaseConnection(Jedis res)
    {
        if (logger.isDebugEnabled())
            logger.info("releasing connection from pool");
        Object poolOrConnection = getConnectionPoolOrConnection();
        if (poolOrConnection instanceof JedisPool)
        {
            ((JedisPool) poolOrConnection).returnResource(res);
        }
    }
424765
public function release($resource)
    {
        $this->idlePool->enqueue($resource);
        //有任务要做
        if (count($this->taskQueue) > 0)
        {
            $this->doTask();
        }
    }
59814
protected synchronized void releaseResources()
    {
        // Set the local flag indicating global resource release is occuring
        _releasingAll = true;

        //
        // Iterate through the list of acquired ResourceContexts and release them
        //
        while (!_resourceContexts.empty())
        {
            ResourceContext resourceContext = _resourceContexts.pop();
            resourceContext.release();
        }

        // Clear the local flag indicating global resource release is occuring
        _releasingAll = false;
    }
1150339
public static void registerResource(Object resource, TaskManager tm) {
		if (resource == null) return;
		synchronized (resources) {
			resources.put(resource, tm);
		}
	}
320507
public void releaseConnection(IPhynixxManagedConnection<C> connection) {
        if (connection == null || !connection.hasCoreConnection()) {
            return;
        }
        try {
            //StringBuilder builder= new StringBuilder(Thread.currentThread().getId()+".releaseConnection starting from "+this.genericObjectPool.getNumIdle()+"/"+this.genericObjectPool.getNumActive());
            this.genericObjectPool.returnObject(connection);
            // LOG.debug(builder.append(" ... to "+Thread.currentThread().getId()+"   "+this.genericObjectPool.getNumIdle()+"/"+this.genericObjectPool.getNumActive()).toString());

        } catch (Exception e) {
            throw new DelegatedRuntimeException(e);
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Proxy " + connection + " returned to Pool");
        }
    }
775732
public void release()
    {
        super.release();

        _forceId = null;
        _forceIdIndex = null;

        _value = null;
        _converter = null;

        _javascriptLocation = null;
        _imageLocation = null;
        _styleLocation = null;
    }
425408
public void release() {
        if (lock != null) {
            try {
                lock.release();
                lock = null;
            } catch (IOException ex) {
                LOGGER.debug("Failed to release lock", ex);
            }
        }
        if (file != null) {
            try {
                file.close();
                file = null;
            } catch (IOException ex) {
                LOGGER.debug("Unable to delete lock file", ex);
            }
        }
        if (lockFile != null && lockFile.isFile()) {
            final String msg = readLockFile();
            if (msg != null && msg.equals(magic) && !lockFile.delete()) {
                LOGGER.error("Lock file '{}' was unable to be deleted. Please manually delete this file.", lockFile.toString());
                lockFile.deleteOnExit();
            }
        }
        lockFile = null;
        removeShutdownHook();
        final Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        LOGGER.debug("Lock released ({}) {} @ {}", Thread.currentThread().getName(), magic, timestamp.toString());
    }