AutoResetEvent Class
Package: @esfx/threading-autoresetevent
Declaration
export declare class AutoResetEvent implements Disposable
Constructors
constructor(initialState)
Constructs a new instance of the AutoResetEvent
class
Declaration
constructor(initialState?: boolean);
Parameters
- initialState
- boolean
constructor(buffer, byteOffset)
Constructs a new instance of the AutoResetEvent
class
Declaration
constructor(buffer: SharedArrayBuffer, byteOffset?: number);
Parameters
- buffer
- SharedArrayBuffer
- byteOffset
- number
Properties
buffer
Gets the SharedArrayBuffer
for this event.
Declaration
get buffer(): SharedArrayBuffer;
Property Value
byteLength
Gets the number of bytes occupied by this event in its buffer.
Declaration
get byteLength(): number;
Property Value
byteOffset
Gets the byte offset of this event in its buffer.
Declaration
get byteOffset(): number;
Property Value
SIZE
Declaration
static readonly SIZE = 4;
Methods
[Disposable.dispose]()
Releases all resources for this event.
Declaration
[Disposable.dispose](): void;
Returns
close()
Releases all resources for this event.
Declaration
close(): void;
Returns
reset()
Sets the state of the event to nonsignaled, causing any threads waiting on the event to block.
Declaration
reset(): boolean;
Returns
true
if the event was reset; otherwise, false
.
set()
Sets the state of the event to signaled, allowing the next thread waiting on the event to proceed.
Declaration
set(): boolean;
Returns
true
if the event was set; otherwise, false
.
waitOne(ms)
Blocks the current thread until this event becomes signaled.
Declaration
waitOne(ms?: number): boolean;
Parameters
Returns
true
if the event was signaled before the timeout expired; otherwise, false
.