File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,18 @@ impl Thread {
46
46
type_ : wasi:: EVENTTYPE_CLOCK ,
47
47
u : wasi:: raw:: __wasi_subscription_u { clock : clock } ,
48
48
} ] ;
49
- let mut out: [ wasi:: Event ; 1 ] = [ unsafe { mem:: zeroed ( ) } ] ;
50
- let n = unsafe { wasi:: poll_oneoff ( & in_, & mut out) . unwrap ( ) } ;
51
- let wasi:: Event { userdata, error, type_, .. } = out[ 0 ] ;
52
- match ( n, userdata, error) {
53
- ( 1 , CLOCK_ID , 0 ) if type_ == wasi:: EVENTTYPE_CLOCK => { }
49
+ let ( res, event) = unsafe {
50
+ let mut out: [ wasi:: Event ; 1 ] = mem:: zeroed ( ) ;
51
+ let res = wasi:: poll_oneoff ( & in_, & mut out) ;
52
+ ( res, out[ 0 ] )
53
+ } ;
54
+ match ( res, event) {
55
+ ( Ok ( 1 ) , wasi:: Event {
56
+ userdata : CLOCK_ID ,
57
+ error : 0 ,
58
+ type_ : wasi:: EVENTTYPE_CLOCK ,
59
+ ..
60
+ } ) => { }
54
61
_ => panic ! ( "thread::sleep(): unexpected result of poll_oneoff" ) ,
55
62
}
56
63
}
You can’t perform that action at this time.
0 commit comments