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