]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/once.h
bluez5-util: Free the adapter_path in device_free().
[pulseaudio] / src / pulsecore / once.h
index c9fe6d0a4942a726384de853bd4c7ce9ac53118d..460a70029ea9765e6459a3b13ab0bc745d1917bb 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef foopulseoncehfoo
 #define foopulseoncehfoo
 
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
@@ -10,7 +8,7 @@
 
   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                                                   \