#locking #async #safe #mutex #containing #sync #require

essential-lock

A minimal crate containing Essential's locking method that is safe to use in async code

2 unstable releases

0.1.0 Jul 8, 2024
0.0.0-release Jul 8, 2024

#463 in Concurrency

34 downloads per month
Used in 3 crates (2 directly)

Apache-2.0

3KB

essential-lock

Crates.io Documentation license Build Status

A minimal crate containing Essential's locking method that is safe to use in async code.


lib.rs:

Lock

This crate is a simple wrapper around sync mutexes that makes it impossible to hold a lock over an await.

It also makes it a lot clearer where the bounds of the lock are which helps make deadlocks easier to debug as a deadlock would require having the call to apply more than once on the stack.

No runtime deps