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)]
8cfg_match! {
9    cfg(target_os = "linux") => {
10        mod linux;
11        use linux as imp;
12    }
13    cfg(target_os = "redox") => {
14        mod linux;
15        use linux as imp;
16    }
17    cfg(unix) => {
18        mod unix;
19        use unix as imp;
20    }
21    cfg(windows) => {
22        mod windows;
23        use self::windows as imp;
24    }
25    _ => {
26        mod unsupported;
27        use unsupported as imp;
28    }
29}
30
31#[cfg(not(bootstrap))]
32cfg_match! {
33    target_os = "linux" => {
34        mod linux;
35        use linux as imp;
36    }
37    target_os = "redox" => {
38        mod linux;
39        use linux as imp;
40    }
41    unix => {
42        mod unix;
43        use unix as imp;
44    }
45    windows => {
46        mod windows;
47        use self::windows as imp;
48    }
49    _ => {
50        mod unsupported;
51        use unsupported as imp;
52    }
53}
54
55pub use imp::Lock;