Closes all open handles to threads in the snapshot.
549103
def close_thread_handles(self):
        
        for aThread in self.iter_threads():
            try:
                aThread.close_handle()
            except Exception:
                try:
                    e = sys.exc_info()[1]
                    msg = "Cannot close thread handle %s, reason: %s"
                    msg %= (aThread.hThread.value, str(e))
                    warnings.warn(msg)
                except Exception:
                    pass
908380
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            // Close all open containers and notify their handles - as this was an unrequested stop.
            ArrayList<ContainerWithHandle> toClose = new ArrayList<>(this.containers.values());
            for (ContainerWithHandle c : toClose) {
                c.container.close();
            }
        }
    }
207160
def clear_processes(self):
        
        #self.close_process_and_thread_handles()
        for aProcess in self.iter_processes():
            aProcess.clear()
        self.__processDict = dict()
415991
public static void close(Iterable<? extends Closeable> closeables)
            throws IOException {
        IOException first = null;
        for (final Closeable c : closeables) {
            if (c == null) {
                LOG.debug("trying to call .close() on null reference");
                continue;
            }
            try {
                c.close();
            } catch (final IOException e) {
                if (first == null) {
                    first = e;
                } else {
                    first.addSuppressed(e);
                }
            }
        }
        if (first != null) {
            throw first;
        }
    }
190947
public void close() {
        Thread responseThread = null;
        synchronized (this) {
            if (!closed) {
                closed = true;
                notifyAll();

                if (listenForCommands) {
                    listenForCommands = false;
                    if (listeningThread != null) {
                        listeningThread.interrupt();
                    }
                }

                Utils.tryToClose(serverSocketChannel);
                commandFile.delete();

                responseThread = this.responseThread.getAndSet(null);
            }
        }

        if (responseThread != null) {
            try {
                responseThread.join();
            } catch (InterruptedException ex) {
            }
        }
    }
290718
def close_handle(self):
        
        try:
            if hasattr(self.hThread, 'close'):
                self.hThread.close()
            elif self.hThread not in (None, win32.INVALID_HANDLE_VALUE):
                win32.CloseHandle(self.hThread)
        finally:
            self.hThread = None
1275659
@Override
    public void closeAll() {

        closed.set(true);

        queues.stream()
              .forEach(Queue::closeAndClear);

    }
1022926
def close(self):
        
        if hasattr(self, "thread"):
            self.thread._exit = True
            self.thread.join(1000)
        if self._conn is not None:
            self._conn.close()
4058
def close(thread_name)
      close_callback = @close_callbacks[thread_name]
      close_callback.call if close_callback
      true
    ensure
      @auditors[thread_name] = nil
      @close_callbacks[thread_name] = nil
    end
660714
public function close()
    {
        if ($this->_handle !== null) {
            fclose($this->_handle);
            $this->_handle = null;
        }
    }
402469
public boolean close()
    {
        if (getDelegate() == null) return true;
        try
        {
            PersistenceBrokerThreadMapping.unsetCurrentPersistenceBroker(getPBKey(), this);
            super.close();
        }
        finally
        {
            /*
            here we destroy the handle. set the
            underlying PB instance 'null', thus it's not
            possible to corrupt a closed PB instance.
            */
            setDelegate(null);
        }
        return true;
    }
1155184
@Override
    public void close() {
        synchronized (startedTasks) {
            if (executor.isShutdown()) {
                return;
            }
            // ... stop updater thread. Do not interrupt.
            executor.shutdown();
            try {
                updater.get();
            } catch (InterruptedException | CancellationException | ExecutionException ignore) {
                // Ignore these closing thread errors.
            }
            // And stop all the tasks, do interrupting.
            for (InternalTask task : startedTasks) {
                task.cancel(true);
            }
            for (InternalTask task : queuedTasks) {
                task.close();
            }

            try {
                executor.awaitTermination(100L, TimeUnit.MILLISECONDS);
            } catch (InterruptedException ignore) {
                Thread.currentThread().interrupt();
            }
        }
    }
894069
public void close() {
    if (lock != null) {
      lock.lock();
    }
    this.connected = false;
    try {
      /* If a streaming result set is open, close it.*/
      skip();
    } catch (Exception e) {
      /* eat exception */
    }

    SendClosePacket.send(writer);
    closeSocket(reader, writer, socket);
    cleanMemory();
    if (lock != null) {
      lock.unlock();
    }
  }
331310
@Override
    public final void close() {
        final CompletableFuture<Void> f;
        synchronized (this) {
            if (state == State.STOPPED) {
                return;
            }
            f = stop(null);
        }

        boolean interrupted = false;
        for (;;) {
            try {
                f.get();
                break;
            } catch (InterruptedException ignored) {
                interrupted = true;
            } catch (ExecutionException e) {
                closeFailed(Exceptions.peel(e));
                break;
            }
        }

        if (interrupted) {
            Thread.currentThread().interrupt();
        }
    }
760012
@Override public void close () {
    if (!disposed) {
      disposed = true;
      if (gfx.exec().isMainThread()) {
        gfx.gl.glDeleteTexture(id);
      } else {
        gfx.exec().invokeNextFrame(new Runnable() {
          public void run () { gfx.gl.glDeleteTexture(id); }
        });
      }
    }
  }
1024712
public  void close() {
		super.clear();
		if (indexMap != null){
			indexMap.clear();
			indexMap = null;
		}
		if (this.indexStore != null){
			getIndexStore().close();
			this.indexStore = null ;
		}
		if (this.cacheStore != null){
			getCacheStore().close();
			this.cacheStore = null ;
		}
	}
215514
public void close () {
		Connection[] connections = this.connections;
		for (int i = 0; i < connections.length; i++)
			connections[i].removeListener(invokeListener);

		synchronized (instancesLock) {
			ArrayList<ObjectSpace> temp = new ArrayList(Arrays.asList(instances));
			temp.remove(this);
			instances = temp.toArray(new ObjectSpace[temp.size()]);
		}

		if (TRACE) trace("kryonet", "Closed ObjectSpace.");
	}