Rest
2 - provisional
Creates a simple lock object with two methods, acquire and acquire_immediately.
acquire
acquire_immediately
The acquire method takes a callback and returns the callback's return value.
The acquire_immediately method will try to acquire the lock immediately, returning an object with both .was_acquired immediate and .result promise.
.was_acquired
.result
This implementation is prone to deadlocks across multiple locks.
See the monolithic create_multi_lock as a potential mitigation to deadlocks.
create_multi_lock
Generated using TypeDoc
Stability
2 - provisional
Creates a simple lock object with two methods,
acquireandacquire_immediately.The
acquiremethod takes a callback and returns the callback's return value.The
acquire_immediatelymethod will try to acquire the lock immediately, returning an object with both.was_acquiredimmediate and.resultpromise.This implementation is prone to deadlocks across multiple locks.
See the monolithic
create_multi_lockas a potential mitigation to deadlocks.