Marks the current {@link BufferBuilder} as finished and clears the state for next one.
760451
private void tryFinishCurrentBufferBuilder(int targetChannel) {
		if (!bufferBuilders[targetChannel].isPresent()) {
			return;
		}
		BufferBuilder bufferBuilder = bufferBuilders[targetChannel].get();
		bufferBuilders[targetChannel] = Optional.empty();
		numBytesOut.inc(bufferBuilder.finish());
		numBuffersOut.inc();
	}
395232
private function finalizeOutputBuffer()
    {
        // Clean out the output buffer to the response, and send the built-up response to the client
        if ($this->isBuffering) {
            $this->response->appendBody(ob_get_contents());
            $this->isBuffering = false;

            ob_end_clean();
        }
    }
792287
private void finishCompletion() {
        // assert state > COMPLETING;
        for (WaitNode q; (q = waiters) != null;) {
            if (U.compareAndSwapObject(this, WAITERS, q, null)) {
                for (;;) {
                    Thread t = q.thread;
                    if (t != null) {
                        q.thread = null;
                        LockSupport.unpark(t);
                    }
                    WaitNode next = q.next;
                    if (next == null)
                        break;
                    q.next = null; // unlink to help gc
                    q = next;
                }
                break;
            }
        }

        done();

        callable = null;        // to reduce footprint
    }
961081
public final void finished()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "finished");

        synchronized(_subCursors)
        {
            for (int priority = Priorities.LOWEST_PRIORITY; priority <= Priorities.HIGHEST_PRIORITY; priority++)
            {
                if (null != _subCursors[priority])
                {
                    _subCursors[priority].finished();
                    _subCursors[priority] = null;
                }
            }
        }
        _owningList._removeCursor(this);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "finished");
    }
809231
public void dispose ()
    {
        if (_buffer != null) {
            // if there are sources bound to this buffer, we must wait
            // for them to be unbound
            if (_bound > 0) {
                _state = UNLOADING;
                return;
            }

            // free up our buffer
            _buffer.delete();
            _buffer = null;
            _state = UNLOADED;
        }
    }
308285
public void finish() throws IOException {
        if (!def.finished()) {
            def.finish();
            while (!def.finished()) {
                int len = def.deflate(buf, 0, buf.length);
                if (def.finished() && len <= buf.length - TRAILER_SIZE) {
                    // last deflater buffer. Fit trailer at the end
                    writeTrailer(buf, len);
                    len = len + TRAILER_SIZE;
                    out.write(buf, 0, len);
                    return;
                }
                if (len > 0)
                    out.write(buf, 0, len);
            }
            // if we can't fit the trailer at the end of the last
            // deflater buffer, we write it separately
            byte[] trailer = new byte[TRAILER_SIZE];
            writeTrailer(trailer, 0);
            out.write(trailer);
        }
    }
1039022
protected void clear() {
        this.data.clear();
        this.buffer.clear();
        this.child = null;
        this.timestamp = Entry.defaultTimestamp;
    }
1180458
public void finish() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Finishing " + this);
        }
        // if there is a print writer, flush any content unless it is already
        // closed. We don't need to do this with streams.
        if (null != this.outWriter) {
            this.outWriter.checkError();
        }
    }
1208320
def __cleanup(self):
        
# TODO: Test this.
        with self.__class__.__locker:

            while self.__read_buffer_index > 0:
                del self.__buffers[0]
                self.__read_buffer_index -= 1
116208
public void finish() throws IOException {
		boolean success = false;

		try {
			checkInProduceState();

			for (ResultSubpartition subpartition : subpartitions) {
				subpartition.finish();
			}

			success = true;
		}
		finally {
			if (success) {
				isFinished = true;

				notifyPipelinedConsumers();
			}
		}
	}
648877
public void finished() {
    final ScheduledFuture<?> scheduled = nextCall.getAndSet(null);

    if (scheduled != null) {
      scheduled.cancel(true);
    }
  }
998200
public EntryBuffer clear() {
    for (int i = 0; i < buffer.length; i++) {
      buffer[i] = null;
    }
    return this;
  }
432866
void flushAll() {
		for (Buffer buff : bufferPool) {
			try {
				buff.getExternalLock().lock();
				buff.flush();
			} finally {
				buff.getExternalLock().unlock();
			}
		}
	}
140200
public void mark(int eventLimit) {
        this.eventLimit = eventLimit;

        // Buffering no events now, clear the buffer and buffered reader
        if (this.eventLimit == 0) {
            this.eventBuffer.clear();
            this.bufferReader = null;
        }
        // Buffering limited set of events, lets trim the buffer if needed
        else if (this.eventLimit > 0) {
            // If there is an iterator check its current position and calculate the new iterator
            // start position
            int iteratorIndex = 0;
            if (this.bufferReader != null) {
                final int nextIndex = this.bufferReader.nextIndex();
                iteratorIndex =
                        Math.max(0, nextIndex - (this.eventBuffer.size() - this.eventLimit));
            }

            // Trim the buffer until it is not larger than the limit
            while (this.eventBuffer.size() > this.eventLimit) {
                this.eventBuffer.poll();
            }

            // If there is an iterator re-create it using the newly calculated index
            if (this.bufferReader != null) {
                this.bufferReader = this.eventBuffer.listIterator(iteratorIndex);
            }
        }
    }
426026
synchronized void markSealed() {
        if (!this.sealed) {
            this.sealed = true;
            this.segmentChunks = Collections.unmodifiableList(this.segmentChunks);
            this.activeChunkHandle = null;
        }
    }
1036084
public void finish() {

        String length = CmsUploadButton.formatBytes(m_contentLength);
        int fileCount = m_orderedFilenamesToUpload.size();
        m_bar.setValue(100);
        m_fileinfo.removeAllRows();
        m_fileinfo.setHTML(0, 0, "<b>" + Messages.get().key(Messages.GUI_UPLOAD_FINISH_UPLOADED_0) + "</b>");
        m_fileinfo.setText(
            0,
            1,
            Messages.get().key(
                Messages.GUI_UPLOAD_FINISH_UPLOADED_VALUE_4,
                new Integer(fileCount),
                new Integer(fileCount),
                getFileText(),
                length));
    }
1088647
@Override
    public void finish() {
        if (started.get() && !finished.getAndSet(true)) {
            waitUntilFinished();
            super.finish();
            // recreate thread (don't start) for processor reuse
            createProcessorThread();
            clearQueues();
            started.set(false);
        }
    }