File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
library/std/src/sys/sgx/waitqueue Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ mod unsafe_list;
18
18
19
19
use crate :: num:: NonZeroUsize ;
20
20
use crate :: ops:: { Deref , DerefMut } ;
21
+ use crate :: panic:: { self , AssertUnwindSafe } ;
21
22
use crate :: time:: Duration ;
22
23
23
24
use super :: abi:: thread;
@@ -157,7 +158,9 @@ impl WaitQueue {
157
158
} ) ) ;
158
159
let entry = guard. queue . inner . push ( & mut entry) ;
159
160
drop ( guard) ;
160
- before_wait ( ) ;
161
+ if let Err ( _e) = panic:: catch_unwind ( AssertUnwindSafe ( || before_wait ( ) ) ) {
162
+ rtabort ! ( "Panic before wait on wakeup event" )
163
+ }
161
164
while !entry. lock ( ) . wake {
162
165
// don't panic, this would invalidate `entry` during unwinding
163
166
let eventset = rtunwrap ! ( Ok , usercalls:: wait( EV_UNPARK , WAIT_INDEFINITE ) ) ;
@@ -181,7 +184,9 @@ impl WaitQueue {
181
184
wake : false ,
182
185
} ) ) ;
183
186
let entry_lock = lock. lock ( ) . queue . inner . push ( & mut entry) ;
184
- before_wait ( ) ;
187
+ if let Err ( _e) = panic:: catch_unwind ( AssertUnwindSafe ( || before_wait ( ) ) ) {
188
+ rtabort ! ( "Panic before wait on wakeup event or timeout" )
189
+ }
185
190
usercalls:: wait_timeout ( EV_UNPARK , timeout, || entry_lock. lock ( ) . wake ) ;
186
191
// acquire the wait queue's lock first to avoid deadlock.
187
192
let mut guard = lock. lock ( ) ;
You can’t perform that action at this time.
0 commit comments