File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ impl KernelModule for RustExample {
102
102
let guard = data. lock ( ) ;
103
103
#[ allow( clippy:: while_immutable_condition) ]
104
104
while * guard != 10 {
105
- cv. wait ( & guard) ;
105
+ let _ = cv. wait ( & guard) ;
106
106
}
107
107
}
108
108
cv. notify_one ( ) ;
@@ -125,7 +125,7 @@ impl KernelModule for RustExample {
125
125
let guard = data. lock ( ) ;
126
126
#[ allow( clippy:: while_immutable_condition) ]
127
127
while * guard != 10 {
128
- cv. wait ( & guard) ;
128
+ let _ = cv. wait ( & guard) ;
129
129
}
130
130
}
131
131
cv. notify_one ( ) ;
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ impl CondVar {
64
64
/// [`CondVar::notify_all`], or when the thread receives a signal.
65
65
///
66
66
/// Returns whether there is a signal pending.
67
+ #[ must_use = "wait returns if a signal is pending, so the caller must check the return value" ]
67
68
pub fn wait < L : Lock > ( & self , guard : & Guard < L > ) -> bool {
68
69
let lock = guard. lock ;
69
70
let mut wait = MaybeUninit :: < bindings:: wait_queue_entry > :: uninit ( ) ;
You can’t perform that action at this time.
0 commit comments