File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ impl Thread {
3030 let nanos = dur. as_nanos ( ) ;
3131 assert ! ( nanos <= u64 :: max_value( ) as u128 ) ;
3232
33+ const CLOCK_ID : wasi:: Userdata = 0x0123_45678 ;
34+
3335 let clock = wasi:: raw:: __wasi_subscription_u_clock_t {
34- identifier : 0x0123_45678 ,
36+ identifier : CLOCK_ID ,
3537 clock_id : wasi:: CLOCK_MONOTONIC ,
3638 timeout : nanos as u64 ,
3739 precision : 0 ,
@@ -47,7 +49,7 @@ impl Thread {
4749 let n = wasi:: poll_oneoff ( & in_, & mut out) . unwrap ( ) ;
4850 let wasi:: Event { userdata, error, type_, .. } = out[ 0 ] ;
4951 match ( n, userdata, error) {
50- ( 1 , 0x0123_45678 , 0 ) if type_ == wasi:: EVENTTYPE_CLOCK => { }
52+ ( 1 , CLOCK_ID , 0 ) if type_ == wasi:: EVENTTYPE_CLOCK => { }
5153 _ => panic ! ( "thread::sleep(): unexpected result of poll_oneoff" ) ,
5254 }
5355 }
You can’t perform that action at this time.
0 commit comments