@@ -73,7 +73,7 @@ macro_rules! new_condvar {
73
73
#[ pin_data]
74
74
pub struct CondVar {
75
75
#[ pin]
76
- pub ( crate ) wait_list : Opaque < bindings:: wait_queue_head > ,
76
+ pub ( crate ) wait_queue_head : Opaque < bindings:: wait_queue_head > ,
77
77
78
78
/// A condvar needs to be pinned because it contains a [`struct list_head`] that is
79
79
/// self-referential, so it cannot be safely moved once it is initialised.
@@ -96,7 +96,7 @@ impl CondVar {
96
96
_pin: PhantomPinned ,
97
97
// SAFETY: `slot` is valid while the closure is called and both `name` and `key` have
98
98
// static lifetimes so they live indefinitely.
99
- wait_list <- Opaque :: ffi_init( |slot| unsafe {
99
+ wait_queue_head <- Opaque :: ffi_init( |slot| unsafe {
100
100
bindings:: __init_waitqueue_head( slot, name. as_char_ptr( ) , key. as_ptr( ) )
101
101
} ) ,
102
102
} )
@@ -108,16 +108,20 @@ impl CondVar {
108
108
// SAFETY: `wait` points to valid memory.
109
109
unsafe { bindings:: init_wait ( wait. get ( ) ) } ;
110
110
111
- // SAFETY: Both `wait` and `wait_list ` point to valid memory.
111
+ // SAFETY: Both `wait` and `wait_queue_head ` point to valid memory.
112
112
unsafe {
113
- bindings:: prepare_to_wait_exclusive ( self . wait_list . get ( ) , wait. get ( ) , wait_state as _ )
113
+ bindings:: prepare_to_wait_exclusive (
114
+ self . wait_queue_head . get ( ) ,
115
+ wait. get ( ) ,
116
+ wait_state as _ ,
117
+ )
114
118
} ;
115
119
116
120
// SAFETY: No arguments, switches to another thread.
117
121
guard. do_unlocked ( || unsafe { bindings:: schedule ( ) } ) ;
118
122
119
- // SAFETY: Both `wait` and `wait_list ` point to valid memory.
120
- unsafe { bindings:: finish_wait ( self . wait_list . get ( ) , wait. get ( ) ) } ;
123
+ // SAFETY: Both `wait` and `wait_queue_head ` point to valid memory.
124
+ unsafe { bindings:: finish_wait ( self . wait_queue_head . get ( ) , wait. get ( ) ) } ;
121
125
}
122
126
123
127
/// Releases the lock and waits for a notification in uninterruptible mode.
@@ -144,10 +148,10 @@ impl CondVar {
144
148
145
149
/// Calls the kernel function to notify the appropriate number of threads with the given flags.
146
150
fn notify ( & self , count : i32 , flags : u32 ) {
147
- // SAFETY: `wait_list ` points to valid memory.
151
+ // SAFETY: `wait_queue_head ` points to valid memory.
148
152
unsafe {
149
153
bindings:: __wake_up (
150
- self . wait_list . get ( ) ,
154
+ self . wait_queue_head . get ( ) ,
151
155
bindings:: TASK_NORMAL ,
152
156
count,
153
157
flags as _ ,
0 commit comments