diff options
Diffstat (limited to 'library/std/src/sys/sync/condvar/no_threads.rs')
| -rw-r--r-- | library/std/src/sys/sync/condvar/no_threads.rs | 26 |
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"); + } +} |
