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 {
375375 let info = info. assume_init ( ) ;
376376 let ticks = nanos * ( info. denom as u64 ) / ( info. numer as u64 ) ;
377377
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+ }
379387 assert_eq ! ( ret, KERN_SUCCESS ) ;
380388 }
381389 }
@@ -395,8 +403,12 @@ impl Thread {
395403 }
396404}
397405
406+ // these come from the `Apple OSS Distributions` xnu source code.
407+ // Specifically: xnu/osfmk/mach/kern_return.h commit 94d3b45 on Github
398408#[ cfg( target_vendor = "apple" ) ]
399409const KERN_SUCCESS : libc:: c_int = 0 ;
410+ #[ cfg( target_vendor = "apple" ) ]
411+ const KERN_SUCCESS : libc:: c_int = 14 ;
400412
401413#[ cfg( target_vendor = "apple" ) ]
402414#[ repr( C ) ]
You can’t perform that action at this time.
0 commit comments