File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -188,12 +188,16 @@ where
188
188
///
189
189
/// If it is called an additional time, it will return None.
190
190
pub fn init_once ( & self , args : <Self as Wrapped >:: I ) -> Option < <Self as Wrapped >:: T > {
191
- if let Err ( _) = self . init . compare_exchange (
192
- KOBJ_UNINITIALIZED ,
193
- KOBJ_INITING ,
194
- Ordering :: AcqRel ,
195
- Ordering :: Acquire ,
196
- ) {
191
+ if self
192
+ . init
193
+ . compare_exchange (
194
+ KOBJ_UNINITIALIZED ,
195
+ KOBJ_INITING ,
196
+ Ordering :: AcqRel ,
197
+ Ordering :: Acquire ,
198
+ )
199
+ . is_err ( )
200
+ {
197
201
return None ;
198
202
}
199
203
let result = self . get_wrapped ( args) ;
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ mod closure {
507
507
508
508
pub unsafe extern "C" fn child ( child : * mut c_void , _p2 : * mut c_void , _p3 : * mut c_void ) {
509
509
let thread_data: Box < ThreadData > = unsafe { Box :: from_raw ( child as * mut ThreadData ) } ;
510
- let closure = ( * thread_data) . closure ;
510
+ let closure = thread_data. closure ;
511
511
closure ( ) ;
512
512
}
513
513
}
You can’t perform that action at this time.
0 commit comments