[pulseaudio-discuss] tests/once-test doesn't build on OS X

Lennart Poettering lennart at poettering.net
Tue Feb 2 00:10:22 PST 2010


On Wed, 27.01.10 08:42, Daniel Mack (daniel at caiaq.de) wrote:

> As the subject says, tests/once-test.c fails to build on OS X because
> pthread_barrier_* is unimplemented on this OS. *sigh*
> 
> What puzzles me is that this test covers functions which aren't used
> anywhere else in the PA sources. What's the idea of testing these
> functions then?

The code that is tested is the pa_once stuff. I added this test
because I was tracking down a race and suspected the problem to be in
pa_once. To increase the chance of triggering the race I used the
barrier stuff so that the many different threads try their best at
executing the same code at the same time.

Now in the end this turned out not to be fruitful, the bug was
elsewhere and outside of PA and the pa_once stuff is apparently rock
solid. Since that however is also some valuable information I kept the
test so that for all future we can be sure that pa_once is free of any
doubt. ;-)

> If the test should stay as it is, we need to build it conditionally for
> !OS_IS_DARWIN. I can send a patch if you like.

Yes, that should safe. Given that the pa_once code is identical for
MacOS and Linux it should be safe having this test on Linux only.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list