1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import { CancellationToken } from "./cancellation";
|
8 | import { Cancelable } from "@esfx/cancelable";
|
9 |
|
10 |
|
11 |
|
12 | export declare class AutoResetEvent {
|
13 | private _signaled;
|
14 | private _waiters;
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 | constructor(initialState?: boolean);
|
21 | /**
|
22 | * Sets the state of the event to signaled, resolving one or more waiting Promises.
|
23 | * The event is then automatically reset.
|
24 | */
|
25 | set(): void;
|
26 | /**
|
27 | * Sets the state of the event to nonsignaled, causing asynchronous operations to pause.
|
28 | */
|
29 | reset(): void;
|
30 | /**
|
31 | * Asynchronously waits for the event to become signaled.
|
32 | *
|
33 | * @param token A CancellationToken used to cancel the request.
|
34 | */
|
35 | wait(token?: CancellationToken | Cancelable): Promise<void>;
|
36 | }
|