@@ -355,7 +355,13 @@ impl Thread {
355
355
}
356
356
}
357
357
358
- #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "tvos" , target_os = "watchos" ) ) ]
358
+ #[ cfg( any(
359
+ target_os = "macos" ,
360
+ target_os = "ios" ,
361
+ target_os = "tvos" ,
362
+ target_os = "watchos" ,
363
+ target_os = "visionos"
364
+ ) ) ]
359
365
pub fn sleep_until ( deadline : crate :: time:: Instant ) {
360
366
use core:: mem:: MaybeUninit ;
361
367
@@ -372,7 +378,7 @@ impl Thread {
372
378
let info = info. assume_init ( ) ;
373
379
let ticks = nanos * ( info. denom as u64 ) / ( info. numer as u64 ) ;
374
380
375
- mach_wait_until ( ticks) ;
381
+ let ret = mach_wait_until ( ticks) ;
376
382
assert_eq ! ( ret, KERN_SUCCESS ) ;
377
383
}
378
384
}
@@ -392,17 +398,35 @@ impl Thread {
392
398
}
393
399
}
394
400
395
- #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "tvos" , target_os = "watchos" ) ) ]
401
+ #[ cfg( any(
402
+ target_os = "macos" ,
403
+ target_os = "ios" ,
404
+ target_os = "tvos" ,
405
+ target_os = "watchos" ,
406
+ target_os = "visionos"
407
+ ) ) ]
396
408
const KERN_SUCCESS : libc:: c_int = 0 ;
397
409
398
- #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "tvos" , target_os = "watchos" ) ) ]
410
+ #[ cfg( any(
411
+ target_os = "macos" ,
412
+ target_os = "ios" ,
413
+ target_os = "tvos" ,
414
+ target_os = "watchos" ,
415
+ target_os = "visionos"
416
+ ) ) ]
399
417
#[ repr( C ) ]
400
418
struct mach_timebase_info_type {
401
419
numer : u32 ,
402
420
denom : u32 ,
403
421
}
404
422
405
- #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "tvos" , target_os = "watchos" ) ) ]
423
+ #[ cfg( any(
424
+ target_os = "macos" ,
425
+ target_os = "ios" ,
426
+ target_os = "tvos" ,
427
+ target_os = "watchos" ,
428
+ target_os = "visionos"
429
+ ) ) ]
406
430
extern "C" {
407
431
fn mach_wait_until ( deadline : u64 ) -> libc:: c_int ;
408
432
fn mach_timebase_info ( info : * mut mach_timebase_info_type ) -> libc:: c_int ;
0 commit comments