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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! ### **NOTE: un-tested. use at your own risk.**
//!
//! # ebri (ebr-integrated)
//! a `no-std` EBR (Epoch-Based Reclamation) implementation.
//! thanks to the idea from [`scc::ebr`](https://docs.rs/scc/2.0.16/scc/ebr/).
//!
//! The epoch consensus algorithm and the use of memory barriers and RMW semantics are similar to
//! that of [`crossbeam_epoch`](https://docs.rs/crossbeam-epoch/), however the API set is vastly
//! different, for instance, `unsafe` blocks are not required to read an instance subject to EBR.
// #![no_std] by default (unless testing or feature "std" enabled)
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use dropguard as drop_guard;
pub use dropguard as exit_guard;
pub use dropguard as defer;
pub use dropguard as defer_guard;
pub use dropguard as destruct_guard;
// importing some alloc types
extern crate alloc;
pub use ;
/// Suspends the garbage collector of the current thread.
///
/// If returns `false` if there is an active [`Guard`] in the thread. Otherwise, it passes all its
/// retired instances to a free flowing garbage container that can be cleaned up by other threads.
///
/// # Examples
///
/// ```
/// use ebri::{suspend, Guard, Shared};
///
/// assert!(suspend());
///
/// {
/// let shared: Shared<usize> = Shared::new(47);
/// let guard = Guard::new();
/// shared.release(&guard);
/// assert!(!suspend());
/// }
///
/// assert!(suspend());
///
/// let new_shared: Shared<usize> = Shared::new(17);
/// let guard = Guard::new();
/// new_shared.release(&guard);
/// ```