|
|
|
|
|
by jcalvinowens
274 days ago
|
|
And here I just want pthread_condattr_setclock() on Darwin. Is there some other interface to set monotonic expiries? I tried to port netconsd to Darwin and that's the sole hang up (well and recvmmsg() but that's trivial...) |
|
Mach absolute time is monotonic. It pauses while the system is asleep, which may or may not be what you want.
If need the timer to keep incrementing while the system is asleep, there's no way to do it directly with a timed wait, but you can use kevent with EVFILT_TIMER + NOTE_MACHTIME + NOTE_MACH_CONTINUOUS_TIME.
[1] https://github.com/apple-oss-distributions/libpthread/blob/1...
[2] https://github.com/apple-oss-distributions/libpthread/blob/1...
[3] https://github.com/apple-oss-distributions/xnu/blob/e3723e1f...