#locking #async #safe #containing #mutex #require #shared

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

#476 in Concurrency

Download history 301/week @ 2024-07-08 15/week @ 2024-07-15 27/week @ 2024-07-22 22/week @ 2024-07-29 12/week @ 2024-08-05 42/week @ 2024-08-12 58/week @ 2024-08-19 22/week @ 2024-08-26

136 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