Semaphore.wait

Suspends the calling thread until the current count moves above zero or until the supplied time period has elapsed. If the count moves above zero in this interval, then atomically decrement the count by one and return true. Otherwise, return false. The supplied period may be up to a maximum of (uint.max - 1) milliseconds.

  1. void wait()
  2. bool wait(double period)
    class Semaphore
    bool
    wait
    (
    double period
    )

Parameters

period double

The number of seconds to wait.

In: period must be less than (uint.max - 1) milliseconds.

Return Value

Type: bool

true if notified before the timeout and false if not.

Throws

SyncException on error.

Meta