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
// Copyright 2019 Brian Gianforcaro
use crateRundownRef;
/// An RAII implementation of a "scoped lock" pattern, but specialized
/// to the needs of run-down protection. When this structure is dropped
/// (falls out of scope), the rundown protection reference that was
/// previously acquired is released.
///
/// This structure is created by the `try_acquire` method on `RundownRef`.
///
/// This type attempts to follow the RAII guidance here:
/// <https://github.com/rust-unofficial/patterns/blob/master/patterns/RAII.md>