]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/mutex.h
dbus: first restart timer, then dispatch it
[pulseaudio] / src / pulsecore / mutex.h
index 36e1d635c5638ca4c8e4e730970452cb017bf76d..b1edc13237512d1c76ac1c1fffc4f87c496ed4e5 100644 (file)
@@ -8,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
 
   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
   License, or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -23,6 +23,7 @@
 ***/
 
 #include <pulsecore/macro.h>
 ***/
 
 #include <pulsecore/macro.h>
+#include <pulsecore/atomic.h>
 
 typedef struct pa_mutex pa_mutex;
 
 
 typedef struct pa_mutex pa_mutex;
 
@@ -45,4 +46,14 @@ void pa_cond_free(pa_cond *c);
 void pa_cond_signal(pa_cond *c, int broadcast);
 int pa_cond_wait(pa_cond *c, pa_mutex *m);
 
 void pa_cond_signal(pa_cond *c, int broadcast);
 int pa_cond_wait(pa_cond *c, pa_mutex *m);
 
+/* Static mutexes are basically just atomically updated pointers to pa_mutex objects */
+
+typedef struct pa_static_mutex {
+    pa_atomic_ptr_t ptr;
+} pa_static_mutex;
+
+#define PA_STATIC_MUTEX_INIT { PA_ATOMIC_PTR_INIT(NULL) }
+
+pa_mutex* pa_static_mutex_get(pa_static_mutex *m, pa_bool_t recursive, pa_bool_t inherit_priority);
+
 #endif
 #endif