mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-20 06:59:53 -05:00
remaining s/assert/pa_assert/ and refcnt.h modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1809 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2988c3d9fb
commit
d5bedbcd98
59 changed files with 967 additions and 724 deletions
|
|
@ -25,21 +25,17 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <pulsecore/macro.h>
|
||||
#include <pulsecore/atomic.h>
|
||||
|
||||
#include "sioman.h"
|
||||
|
||||
static int stdio_inuse = 0;
|
||||
static pa_atomic_t stdio_inuse = PA_ATOMIC_INIT(0);
|
||||
|
||||
int pa_stdio_acquire(void) {
|
||||
if (stdio_inuse)
|
||||
return -1;
|
||||
|
||||
stdio_inuse = 1;
|
||||
return 0;
|
||||
return pa_atomic_cmpxchg(&stdio_inuse, 0, 1) ? 0 : -1;
|
||||
}
|
||||
|
||||
void pa_stdio_release(void) {
|
||||
assert(stdio_inuse);
|
||||
stdio_inuse = 0;
|
||||
pa_assert_se(pa_atomic_cmpxchg(&stdio_inuse, 1, 0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue