File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: fmt;
2
- // FIXME(nonpoison_mutex,nonpoison_condvar): switch to nonpoison versions once they are available
3
- use crate :: sync:: { Condvar , Mutex } ;
2
+ use crate :: sync:: nonpoison:: { Condvar , Mutex } ;
4
3
5
4
/// A barrier enables multiple threads to synchronize the beginning
6
5
/// of some computation.
@@ -118,12 +117,11 @@ impl Barrier {
118
117
/// ```
119
118
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
120
119
pub fn wait ( & self ) -> BarrierWaitResult {
121
- let mut lock = self . lock . lock ( ) . unwrap ( ) ;
120
+ let mut lock = self . lock . lock ( ) ;
122
121
let local_gen = lock. generation_id ;
123
122
lock. count += 1 ;
124
123
if lock. count < self . num_threads {
125
- let _guard =
126
- self . cvar . wait_while ( lock, |state| local_gen == state. generation_id ) . unwrap ( ) ;
124
+ let _guard = self . cvar . wait_while ( lock, |state| local_gen == state. generation_id ) ;
127
125
BarrierWaitResult ( false )
128
126
} else {
129
127
lock. count = 0 ;
You can’t perform that action at this time.
0 commit comments