summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_data_structures/src/flock.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /compiler/rustc_data_structures/src/flock.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_data_structures/src/flock.rs')
-rw-r--r--compiler/rustc_data_structures/src/flock.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/flock.rs b/compiler/rustc_data_structures/src/flock.rs
new file mode 100644
index 000000000..e395d8dbb
--- /dev/null
+++ b/compiler/rustc_data_structures/src/flock.rs
@@ -0,0 +1,26 @@
+//! Simple file-locking apis for each OS.
+//!
+//! This is not meant to be in the standard library, it does nothing with
+//! green/native threading. This is just a bare-bones enough solution for
+//! librustdoc, it is not production quality at all.
+
+#![allow(non_camel_case_types)]
+#![allow(nonstandard_style)]
+
+cfg_if! {
+ if #[cfg(target_os = "linux")] {
+ mod linux;
+ use linux as imp;
+ } else if #[cfg(unix)] {
+ mod unix;
+ use unix as imp;
+ } else if #[cfg(windows)] {
+ mod windows;
+ use windows as imp;
+ } else {
+ mod unsupported;
+ use unsupported as imp;
+ }
+}
+
+pub use imp::Lock;