]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/thread.h
conf-parser: make use of pa_strip() wherever applicable
[pulseaudio] / src / pulsecore / thread.h
index 87e850d67eae41221c92c595c6655fd70d1695ad..60c1267b5b758fd2d0e5403771a08042579173cf 100644 (file)
@@ -9,7 +9,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
@@ -25,6 +25,7 @@
 
 #include <pulse/def.h>
 #include <pulsecore/once.h>
+#include <pulsecore/core-util.h>
 
 #ifndef PACKAGE
 #error "Please include config.h before including this file!"
@@ -54,7 +55,7 @@ void *pa_tls_set(pa_tls *t, void *userdata);
 #define PA_STATIC_TLS_DECLARE(name, free_cb)                            \
     static struct {                                                     \
         pa_once once;                                                   \
-        pa_tls *tls;                                                    \
+        pa_tls *volatile tls;                                           \
     } name##_tls = {                                                    \
         .once = PA_ONCE_INIT,                                           \
         .tls = NULL                                                     \
@@ -69,6 +70,8 @@ void *pa_tls_set(pa_tls *t, void *userdata);
     static void name##_tls_destructor(void) PA_GCC_DESTRUCTOR;          \
     static void name##_tls_destructor(void) {                           \
         static void (*_free_cb)(void*) = free_cb;                       \
+        if (!pa_in_valgrind())                                          \
+            return;                                                     \
         if (!name##_tls.tls)                                            \
             return;                                                     \
         if (_free_cb) {                                                 \