rustc_data_structures/
flock.rs

1//! Simple file-locking apis for each OS.
2//!
3//! This is not meant to be in the standard library, it does nothing with
4//! green/native threading. This is just a bare-bones enough solution for
5//! librustdoc, it is not production quality at all.
6
7// cfg(bootstrap)
8macro_rules! cfg_select_dispatch {
9    ($($tokens:tt)*) => {
10        #[cfg(bootstrap)]
11        cfg_match! { $($tokens)* }
12
13        #[cfg(not(bootstrap))]
14        cfg_select! { $($tokens)* }
15    };
16}
17
18cfg_select_dispatch! {
19    target_os = "linux" => {
20        mod linux;
21        use linux as imp;
22    }
23    target_os = "redox" => {
24        mod linux;
25        use linux as imp;
26    }
27    unix => {
28        mod unix;
29        use unix as imp;
30    }
31    windows => {
32        mod windows;
33        use self::windows as imp;
34    }
35    _ => {
36        mod unsupported;
37        use unsupported as imp;
38    }
39}
40
41pub use imp::Lock;