once: Fix race causing pa_once to sometimes run twice
commit1ba655560d2636d952a56a6f7013ecc0df13cd5b
authorDavid Henningsson <david.henningsson@canonical.com>
Fri, 18 May 2012 20:29:41 +0000 (18 22:29 +0200)
committerDavid Henningsson <david.henningsson@canonical.com>
Fri, 25 May 2012 08:50:37 +0000 (25 10:50 +0200)
treeb54ca7e4b04342fc4ae4296b7851aca7fa57e8d1
parent4c65e58325fabde724eb340da6ce2c9988e45871
once: Fix race causing pa_once to sometimes run twice

There was a race in the existing code that could cause the pa_once code
to be run twice, see:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013354.html

Therefore the existing implementation was rewritten to instead look like
the reference implementation here:
http://www.hpl.hp.com/research/linux/atomic_ops/example.php4

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
src/pulsecore/once.c
src/pulsecore/once.h