|
2 | 2 | extern crate cfg_if; |
3 | 3 | #[cfg_attr(not(any(target_os = "redox", target_os = "haiku")), macro_use)] |
4 | 4 | extern crate nix; |
5 | | -#[macro_use] |
6 | | -extern crate lazy_static; |
7 | 5 |
|
8 | 6 | mod common; |
9 | 7 | mod sys; |
@@ -79,24 +77,22 @@ fn read_exact<Fd: AsFd>(f: Fd, buf: &mut [u8]) { |
79 | 77 | } |
80 | 78 | } |
81 | 79 |
|
82 | | -lazy_static! { |
83 | | - /// Any test that changes the process's current working directory must grab |
84 | | - /// the RwLock exclusively. Any process that cares about the current |
85 | | - /// working directory must grab it shared. |
86 | | - pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); |
87 | | - /// Any test that creates child processes must grab this mutex, regardless |
88 | | - /// of what it does with those children. |
89 | | - pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); |
90 | | - /// Any test that changes the process's supplementary groups must grab this |
91 | | - /// mutex |
92 | | - pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); |
93 | | - /// Any tests that loads or unloads kernel modules must grab this mutex |
94 | | - pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); |
95 | | - /// Any test that calls ptsname(3) must grab this mutex. |
96 | | - pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); |
97 | | - /// Any test that alters signal handling must grab this mutex. |
98 | | - pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); |
99 | | -} |
| 80 | +/// Any test that creates child processes must grab this mutex, regardless |
| 81 | +/// of what it does with those children. |
| 82 | +pub static FORK_MTX: std::sync::Mutex<()> = std::sync::Mutex::new(()); |
| 83 | +/// Any test that changes the process's current working directory must grab |
| 84 | +/// the RwLock exclusively. Any process that cares about the current |
| 85 | +/// working directory must grab it shared. |
| 86 | +pub static CWD_LOCK: RwLock<()> = RwLock::new(()); |
| 87 | +/// Any test that changes the process's supplementary groups must grab this |
| 88 | +/// mutex |
| 89 | +pub static GROUPS_MTX: Mutex<()> = Mutex::new(()); |
| 90 | +/// Any tests that loads or unloads kernel modules must grab this mutex |
| 91 | +pub static KMOD_MTX: Mutex<()> = Mutex::new(()); |
| 92 | +/// Any test that calls ptsname(3) must grab this mutex. |
| 93 | +pub static PTSNAME_MTX: Mutex<()> = Mutex::new(()); |
| 94 | +/// Any test that alters signal handling must grab this mutex. |
| 95 | +pub static SIGNAL_MTX: Mutex<()> = Mutex::new(()); |
100 | 96 |
|
101 | 97 | /// RAII object that restores a test's original directory on drop |
102 | 98 | struct DirRestore<'a> { |
|
0 commit comments