Create a Latch for the specified number of participants.
Number of countDown calls required to release the latch.
Returns true if the latch has been released.
Decrement the latch. When the count reaches zero, all waiters are released.
Wait for the latch to be released. Resolves when countDown() has been called count times.
Optionalsignal: AbortSignal | nullAn optional AbortSignal to cancel the wait operation.
A promise that resolves when the latch is released.
An asynchronous reusable latch for N participants.
All waiters are released together when the latch is released (countdown reaches zero).
After releasing all waiters, the latch remains released.
Example