SharedThreadContainer

A "shared" thread container. A shared thread container doesn't have an owner and is intended for unstructured uses, e.g. thread pools.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Return the stream of children of this container.

Link copied to clipboard
open override fun close()

Closes this container. Further attempts to start a thread in this container throw IllegalStateException. This method has no impact on threads that are still running or starting around the time that this method is invoked.

Link copied to clipboard

Returns the scope that encloses this scope.

Returns the scope of the given type that encloses this scope.

Link copied to clipboard
open override fun name(): String

Return the name of this container, may be null.

Link copied to clipboard
open override fun onExit(thread: Job)

Invoked when a Thread terminates or starting it fails.

Link copied to clipboard
open override fun onStart(thread: Job)

Invoked by Thread::start before the given Thread is started.

Link copied to clipboard
open override fun owner(): Job?

Returns the scope owner or null if not owned.

Link copied to clipboard
open override fun parent(): ThreadContainer?

Returns the parent of this container or null if this is the root container.

Link copied to clipboard
suspend fun popForcefully(): Boolean

Pops this scope from the current thread's scope stack.

Link copied to clipboard

Returns the scope that directly encloses this scope, null if none.

Link copied to clipboard
open suspend fun push(): StackableScope

Pushes this scope onto the current thread's scope stack.

Link copied to clipboard
fun start(thread: Job)

Starts a thread in this container.

Link copied to clipboard
open fun threadCount(): Long

Return a count of the number of threads in this container.

Link copied to clipboard
open override fun threads(): Sequence<Job>

Returns a stream of the live threads in this container.

Link copied to clipboard
open override fun toString(): String

The scoped values captured when the thread container was created.

Link copied to clipboard
suspend fun tryPop(): Boolean

Pops this scope from the current thread's scope stack if the scope is at the top of stack.