about summary refs log tree commit diff
path: root/library/std/src/sys/sync/condvar/no_threads.rs
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-03-12 14:55:06 +0100
committerjoboet <jonasboettiger@icloud.com>2024-03-12 15:41:06 +0100
commit22a5267c83a3e17f2b763279eb24bb632c45dc6b (patch)
tree81eca4925b77ec92b4f2fd66962af948fe59d094 /library/std/src/sys/sync/condvar/no_threads.rs
parent3b85d2c7fc6d1698e68b94f7bc1a5c9633f2554d (diff)
downloadrust-22a5267c83a3e17f2b763279eb24bb632c45dc6b.tar.gz
rust-22a5267c83a3e17f2b763279eb24bb632c45dc6b.zip
std: move `Once` implementations to `sys`
Diffstat (limited to 'library/std/src/sys/sync/condvar/no_threads.rs')
-rw-r--r--library/std/src/sys/sync/condvar/no_threads.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/std/src/sys/sync/condvar/no_threads.rs b/library/std/src/sys/sync/condvar/no_threads.rs
new file mode 100644
index 00000000000..36b89c5f5be
--- /dev/null
+++ b/library/std/src/sys/sync/condvar/no_threads.rs
@@ -0,0 +1,26 @@
+use crate::sys::sync::Mutex;
+use crate::time::Duration;
+
+pub struct Condvar {}
+
+impl Condvar {
+    #[inline]
+    #[rustc_const_stable(feature = "const_locks", since = "1.63.0")]
+    pub const fn new() -> Condvar {
+        Condvar {}
+    }
+
+    #[inline]
+    pub fn notify_one(&self) {}
+
+    #[inline]
+    pub fn notify_all(&self) {}
+
+    pub unsafe fn wait(&self, _mutex: &Mutex) {
+        panic!("condvar wait not supported")
+    }
+
+    pub unsafe fn wait_timeout(&self, _mutex: &Mutex, _dur: Duration) -> bool {
+        panic!("condvar wait not supported");
+    }
+}