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
//! Useful objects and functions.
use ;
/// A convenient zero-overhead wrapper for volatile fields that implement `Copy` and `Clone`.
///
/// This allows writing and reading volatile fields without resorting to `unsafe`.
///
/// An important difference with another popular implementation of `VolatileCell` is that interior
/// mutability is not allowed. Although it may at first appear logical to allow a volatile
/// `Send` and `Sync` type to provide interior mutability arguing that the value may anyway be
/// changed by another process, this may wrongly lead the user into believing that volatile
/// values can be used used for inter-thread communication (see A. D. Robinson's essay:
/// "Volatile: Almost Useless for Multi-Threaded Programming").