Event
public final class Event: Lock
A thread event object. Inherits from Threading.Lock
.
The event MUST be locked before wait
or signal
is called.
While inside the wait
call, the event is automatically placed in the unlocked state.
After wait
or signal
return the event will be in the locked state and must be unlocked.
-
Initialize a new Event object.
Declaration
Swift
override public init()
-
Signal at most ONE thread which may be waiting on this event. Has no effect if there is no waiting thread.
Declaration
Swift
public func signal() -> Bool
-
Signal ALL threads which may be waiting on this event. Has no effect if there is no waiting thread.
Declaration
Swift
public func broadcast() -> Bool