A mutual exclusion (mutex) class that ensures only one asynchronous operation
can execute at a time, providing thread-safe execution of critical sections.
Example
constmutex = newMutex();
// Only one of these will execute at a time mutex.lock(async () => { // Critical section code here returnsomeAsyncOperation(); });
A mutual exclusion (mutex) class that ensures only one asynchronous operation can execute at a time, providing thread-safe execution of critical sections.
Example