#ifndef foopulseoncehfoo
#define foopulseoncehfoo
-/* $Id$ */
-
/***
This file is part of PulseAudio.
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2 of the
+ published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
USA.
***/
-#include <pulsecore/mutex.h>
#include <pulsecore/atomic.h>
+#include <pulsecore/mutex.h>
typedef struct pa_once {
- pa_atomic_ptr_t mutex;
- pa_atomic_t ref, done;
+ pa_static_mutex mutex;
+ pa_atomic_t done;
} pa_once;
#define PA_ONCE_INIT \
{ \
- .mutex = PA_ATOMIC_PTR_INIT(NULL), \
- .ref = PA_ATOMIC_INIT(0), \
+ .mutex = PA_STATIC_MUTEX_INIT, \
.done = PA_ATOMIC_INIT(0) \
}
/* Not to be called directly, use the macros defined below instead */
-int pa_once_begin(pa_once *o);
+bool pa_once_begin(pa_once *o);
void pa_once_end(pa_once *o);
#define PA_ONCE_BEGIN \