4 releases

0.4.2 Oct 27, 2022
0.4.1 Jul 25, 2022
0.4.0 May 27, 2021
0.3.0 Nov 16, 2020
0.1.1 May 27, 2018

#641 in Concurrency


Used in drop-bin

MIT license

6KB
105 lines

A simple non-blocking mutex (i.e. only try_lock is supported), using atomics.

Simpler than the one found in stdlib. Does not support poisoning.

This used to be faster than the mutex in the standard library, but benchmarking indicates that optimizations in the standard library means there is no longer a significant difference (on my machine). Be sure to run them on your own machine to compare.

Nevertheless, this library may still be useful for embedded or similar cases.


lib.rs:

Provides a simple mutex that does not support blocking or poisoning, but is faster and simpler than the mutex in stdlib.

No runtime deps