1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! # No-Operation Lock
//!
//! `NoLock` is a "dummy" synchronization primitive that performs no actual locking.
//! Use this when your application is guaranteed to be single-threaded or when
//! higher-level logic ensures mutual exclusion.
//!
//! ## Performance
//! This is a zero-cost abstraction. The `lock()` call is a no-op and the compiler
//! will likely optimize it away entirely.
use LockTrait;
use PhantomData;
/// A non-functional lock for single-threaded use.
///
/// It contains padding to ensure that even a "no-lock" slab header maintains
/// a predictable memory footprint.