Scoop API

scoop:scoop.platform:0.1.0

ConditionVariable

class ConditionVariable

source · line 10
public
public class ConditionVariable public constructor(
    /**
     * The mutex released during waiting and reacquired before return.
     */
    public val mutex: Mutex
) : Disposable

A native condition variable associated with one mutex. Wait while holding that mutex and recheck the application predicate after waking.

property mutex

source · line 14
public
public val mutex: Mutex

get: public read-only

The mutex released during waiting and reacquired before return.

function signal

source · line 87
public
public fun signal(): Unit

Wakes one eligible waiter; callers must still protect the shared predicate with the associated mutex.

function await

source · line 52
public
public fun await(): Unit

Atomically releases the held mutex while waiting, then reacquires it. The timed overload returns false on timeout; a wake does not prove the application predicate.

function broadcast

source · line 93
public
public fun broadcast(): Unit

Wakes all eligible waiters so they can recheck their predicates.

function await

source · line 59
public
public fun await(timeout: Duration): Boolean

Atomically releases the held mutex while waiting, then reacquires it. The timed overload returns false on timeout; a wake does not prove the application predicate.

function dispose

source · line 108
public
public override fun dispose(): Unit

Destroys the condition variable; disposal with an active wait is rejected.