[pulseaudio-discuss] [PATCH 4/4] Wrap clock_gettime and friends
lennart at poettering.net
Wed Sep 16 14:48:58 PDT 2009
On Wed, 16.09.09 15:15, Daniel Mack (daniel at caiaq.de) wrote:
> From: Kim Lester <kim at dfusion.com.au>
> OS X does not define clockid_t or clock_gettime() and friends.
> Add a wrapper to fix this.
Hmpf. I am not particularly happy with this. This adds a lot of
unnecessary compat code. We don't actually need implementations of
clock_getres(). All we need is some kind of check whether system
timers are accurate or whether they are rounded up to scheduling
slices. On Linux we do that check with clock_getres(), but all the
information it returns is actually not intertesting at all. We just
check if this is below some trheshold, that's all.
clock_settime() we don't use at all! We shouldn't carry compat code
And clock_gettime we don't really need either. We need some kind of
accurate system timers (preferably monotonic), and on Linux we use
clock_gettime() for that. But we already have a fallback there for
Or in other words, the current APIs pa_rtclock_get(),
pa_rtclock_hrtimer() is supposed to be the abstract API that has
different backends on different systems. I'd very much prefer if any
MacOS specific code would simply be plugged in there instead of
creating various new abstraction interfaces!
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss