Skip to content

Commit 3ccd3fe

Browse files
committed
Panic when condvar will never be notified
1 parent 55fc005 commit 3ccd3fe

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

library/std/src/sys/sync/condvar/no_threads.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ impl Condvar {
2929
pub unsafe fn wait(&self, _mutex: &Mutex) {
3030
let mut value = self.value.borrow_mut();
3131
if *value == 0 {
32-
// Since the target does not have threads,
33-
// no notification can ever arrive.
34-
loop {}
32+
panic!("condvar will never be notified");
3533
} else {
3634
*value -= 1;
3735
}

0 commit comments

Comments
 (0)