Release all the resource.
549806
void release() {
    /* release current download request */
    cancelAll();

    /* release download queue */
    if (downloadQueue != null) {
      downloadQueue = null;
    }

    /* release dispathcers */
    if (dispatchers != null) {
      stop();

      for (int i = 0; i < dispatchers.length; i++) {
        dispatchers[i] = null;
      }

      dispatchers = null;
    }
  }
1336472
def remove(self, resource):
        """"""
        if isinstance(resource, Resource):
            self._resources.remove(resource)
1086595
public void release()
    {
        for(String name : all)
        {
            allColumnFamilyMetrics.get(name).remove(Metrics.defaultRegistry().allMetrics().get(factory.createMetricName(name)));
            Metrics.defaultRegistry().removeMetric(factory.createMetricName(name));
        }
        readLatency.release();
        writeLatency.release();
        rangeLatency.release();
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("EstimatedRowSizeHistogram"));
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("EstimatedColumnCountHistogram"));
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("KeyCacheHitRate"));
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("CoordinatorReadLatency"));
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("CoordinatorScanLatency"));
        Metrics.defaultRegistry().removeMetric(factory.createMetricName("WaitingOnFreeMemtableSpace"));
    }
199651
public void destroy()
  {
    TempBuffer ptr = _head;

    _head = null;
    _tail = null;

    TempBuffer.freeAll(ptr);
  }
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.");
		}
	}
1317002
protected void releaseResources()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);

        // If the state is not complete, then the ContainerTx should not
        // be cleared, and should not be returned to the pool.  This is common
        // for BMT, where a method may begin the tx, but not complete it
        // until a subsequent method call.                                 d157262
        if (state != COMMITTED && state != ROLLEDBACK)
        {
            return;
        }

        // Simply clear all instance variables that may hold a reference to
        // another object.                                                 d215317

        afterList = null;
        beanOList = null;
        beanOs = null;
        cmdAccessor = null;
        containerAS = null;
        currentBeanOs = null;
        finderSyncList = null;
        homesForPMManagedBeans = null;
        ivContainer = null;
        ivPostProcessingException = null; // PQ90221
        ivTxKey = null;
        tempList = null;
        txListener = null;
        uowCtrl = null;
        timersQueuedToStart = null; // F743-425.CodRev
        timersCanceled = null; // F743-425.CodRev
    }
118929
public void releaseAndTryRemoveAll() throws Exception {
		Collection<String> children = getAllPaths();

		Exception exception = null;

		for (String child : children) {
			try {
				releaseAndTryRemove('/' + child);
			} catch (Exception e) {
				exception = ExceptionUtils.firstOrSuppressed(e, exception);
			}
		}

		if (exception != null) {
			throw new Exception("Could not properly release and try removing all state nodes.", exception);
		}
	}
154317
public void reclaimAll ()
    {
        // make sure any bound sources are released
        for (PooledSource pooled : _sources) {
            if (pooled.holder != null) {
                pooled.holder.stop();
                pooled.holder.reclaim();
                pooled.holder = null;
            }
        }
    }
1051178
@Override
	public void close() {

		// copy all resources as the close of a resource modifies the
		// xaresources ...
		Set<PhynixxXAResource<T>> tmpXAResources = new HashSet<PhynixxXAResource<T>>();
		synchronized (xaresources) {
			if (this.xaresources.size() > 0) {
				tmpXAResources.addAll(xaresources);
			}
		}
		// close all reopen XAResources ....
		for (Iterator<PhynixxXAResource<T>> iterator = tmpXAResources.iterator(); iterator.hasNext();) {
			PhynixxXAResource<T> xaresource = iterator.next();
			xaresource.close();
		}

		this.getXATransactionalBranchRepository().close();
	}
1284692
public void releaseAll(Object owner) {
		if (owner == null) {
			return;
		}

		// -------------------- BEGIN CRITICAL SECTION -------------------
		synchronized (lock) {
			if (isShutDown) {
				throw new IllegalStateException("Memory manager has been shut down.");
			}

			// get all segments
			final Set<MemorySegment> segments = allocatedSegments.remove(owner);

			// all segments may have been freed previously individually
			if (segments == null || segments.isEmpty()) {
				return;
			}

			// free each segment
			if (isPreAllocated) {
				for (MemorySegment seg : segments) {
					memoryPool.returnSegmentToPool(seg);
				}
			}
			else {
				for (MemorySegment seg : segments) {
					seg.free();
				}
				numNonAllocatedPages += segments.size();
			}

			segments.clear();
		}
		// -------------------- END CRITICAL SECTION -------------------
	}
949516
public void releaseExternalResources() {

        if (!isClosed.get()) {
            logger.info("Releasing all ParallelClient resources... ");
            ActorConfig.shutDownActorSystemForce();
            httpClientStore.shutdown();
            tcpSshPingResourceStore.shutdown();
            cleanWaitTaskQueue();
            cleanInprogressJobMap();
            isClosed.set(true);
            logger.info("Have released all ParallelClient resources "
                    + "(actor system + async+sync http client + task queue)"
                    + "\nNow safe to stop your application.");

        } else {
            logger.debug("NO OP. ParallelClient resources have already been released.");
        }

    }
310155
def release(self) -> None:
        """"""
        if self._value >= self._initial_value:
            raise ValueError("Semaphore released too many times")
        super(BoundedSemaphore, self).release()
840236
def release(self):
		
		if self._locked is True:
			self._locked = False
			self._lock.release()
1182922
@Override
    protected void releaseResourceImpl(MailResourcesHolder resource)
    {
        //get transport
        Transport transport=resource.getTransport();

        if(transport!=null)
        {
            if(transport.isConnected())
            {
                try
                {
                    //close connection
                    transport.close();
                }       
                catch(Throwable throwable)
                {
                    //ignore
                }
            }
        }
    }
1008172
def _release(self):
        """"""
        if self._in_use is None:
            # The holder is not checked out.
            return

        if not self._in_use.done():
            self._in_use.set_result(None)
        self._in_use = None

        # Deinitialize the connection proxy.  All subsequent
        # operations on it will fail.
        if self._proxy is not None:
            self._proxy._detach()
            self._proxy = None

        # Put ourselves back to the pool queue.
        self._pool._queue.put_nowait(self)
45439
protected static void blockAndReleaseAllCloseableResources()
    {
        synchronized(CloseableResourceManager.class)
        {
            //set flag
            CloseableResourceManager.active=false;
        }
        
        Closeable[] closeables=null;
        synchronized(CloseableResourceManager.RESOURCES)
        {
            //get resources
            closeables=CloseableResourceManager.RESOURCES.toArray(new Closeable[CloseableResourceManager.RESOURCES.size()]);
        }
        
        //get amount
        int amount=closeables.length;
        
        Closeable closeable=null;
        for(int index=0;index<amount;index++)
        {
            //get next element
            closeable=closeables[index];
            
            //close resource
            IOHelper.closeResource(closeable);
        }
    }
445965
public function release()
    {
        $this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner);
    }