Provides a simple lock mechanism to ensure that only one operation can be executed at a time.
Creates a new Lock instance.
Executes a function while holding the lock. The function will be awaited. If an error is thrown during the function execution, it will be propagated; lock will be released regardless.
The function to execute while holding the lock.
The result of the function execution (awaited).
Provides a simple lock mechanism to ensure that only one operation can be executed at a time.