Acquires the lock, waiting if necessary until it is available.
Optionalsignal: AbortSignal | nullAn optional AbortSignal to cancel the acquire operation.
A promise that resolves when the lock is acquired.
Attempts to acquire the lock without waiting.
True if the lock was successfully acquired, false otherwise.
Releases the lock.
A mutex (mutual exclusion) primitive for asynchronous tasks.
A mutex allows only one task to hold the lock at a time. Other tasks attempting to acquire the lock will wait until it is released.
The order of lock acquisition is guaranteed to be FIFO (first-in-first-out).