File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
library/std/src/sys/pal/unix Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,15 @@ impl Thread {
375
375
let info = info. assume_init ( ) ;
376
376
let ticks = nanos * ( info. denom as u64 ) / ( info. numer as u64 ) ;
377
377
378
- let ret = mach_wait_until ( ticks) ;
378
+ loop {
379
+ // There are no docs on the mach_wait_until some details can be
380
+ // learned from the `Apple OSS Distributions` xnu source code.
381
+ // Specifically: xnu/osfmk/clock.h commit 94d3b45 on Github
382
+ let ret = mach_wait_until ( ticks) ;
383
+ if ret != KERN_ABORTED {
384
+ break ;
385
+ }
386
+ }
379
387
assert_eq ! ( ret, KERN_SUCCESS ) ;
380
388
}
381
389
}
@@ -395,8 +403,12 @@ impl Thread {
395
403
}
396
404
}
397
405
406
+ // these come from the `Apple OSS Distributions` xnu source code.
407
+ // Specifically: xnu/osfmk/mach/kern_return.h commit 94d3b45 on Github
398
408
#[ cfg( target_vendor = "apple" ) ]
399
409
const KERN_SUCCESS : libc:: c_int = 0 ;
410
+ #[ cfg( target_vendor = "apple" ) ]
411
+ const KERN_SUCCESS : libc:: c_int = 14 ;
400
412
401
413
#[ cfg( target_vendor = "apple" ) ]
402
414
#[ repr( C ) ]
You can’t perform that action at this time.
0 commit comments