[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-127-g84cd233

Lennart Poettering gitmailer-noreply at 0pointer.de
Sat Nov 1 13:29:30 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  adc2973c8dfab862d4333e0c1206995cd2df20c6 (commit)

- Log -----------------------------------------------------------------
84cd233... Make sure libpulse never gets unloaded
58b53bb... a bit of pa_bool_t'ization
-----------------------------------------------------------------------

Summary of changes:
 src/Makefile.am      |    2 +-
 src/pulsecore/once.c |   11 ++++++-----
 src/pulsecore/once.h |    2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------

commit 58b53bbc1adb62f2a55e1654f97f90df7518f7fd
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Nov 1 21:10:26 2008 +0100

    a bit of pa_bool_t'ization

diff --git a/src/pulsecore/once.c b/src/pulsecore/once.c
index 989741d..3d4543c 100644
--- a/src/pulsecore/once.c
+++ b/src/pulsecore/once.c
@@ -28,13 +28,13 @@
 
 #include "once.h"
 
-int pa_once_begin(pa_once *control) {
+pa_bool_t pa_once_begin(pa_once *control) {
     pa_mutex *m;
 
     pa_assert(control);
 
     if (pa_atomic_load(&control->done))
-        return 0;
+        return FALSE;
 
     pa_atomic_inc(&control->ref);
 
@@ -50,15 +50,17 @@ int pa_once_begin(pa_once *control) {
              * wait until it is unlocked */
             pa_mutex_lock(m);
 
+            pa_assert(pa_atomic_load(&control->done));
+
             pa_once_end(control);
-            return 0;
+            return FALSE;
         }
 
         pa_assert_se(m = pa_mutex_new(FALSE, FALSE));
         pa_mutex_lock(m);
 
         if (pa_atomic_ptr_cmpxchg(&control->mutex, NULL, m))
-            return 1;
+            return TRUE;
 
         pa_mutex_unlock(m);
         pa_mutex_free(m);
@@ -91,4 +93,3 @@ void pa_run_once(pa_once *control, pa_once_func_t func) {
         pa_once_end(control);
     }
 }
-
diff --git a/src/pulsecore/once.h b/src/pulsecore/once.h
index 576d40f..c0191ef 100644
--- a/src/pulsecore/once.h
+++ b/src/pulsecore/once.h
@@ -38,7 +38,7 @@ typedef struct pa_once {
     }
 
 /* Not to be called directly, use the macros defined below instead */
-int pa_once_begin(pa_once *o);
+pa_bool_t pa_once_begin(pa_once *o);
 void pa_once_end(pa_once *o);
 
 #define PA_ONCE_BEGIN                                                   \

commit 84cd23303550cdc3aa605add9f8a2faa3fc1c3e1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Nov 1 21:11:48 2008 +0100

    Make sure libpulse never gets unloaded
    
    When an .so is unloaded during runtime all TLS keys it has registered
    need to be freed because the destructor callbacks of the TLS key might
    otherwise point to invalid code. Hence it would appear sensible to
    destruct the TLS keys from a function marked as __attribute__
    ((destructor)). However functions marked like that are also called when
    an application terminates, on exit(). If a thread continues to run until
    the very exit it might still want to access that TLS data. The
    destructor functions are called while all other threads are still
    running. If __attribute ((destructor)) is used to destruct TLS keys for
    such threads this might hence cause a crash when the application shuts
    down.
    
    To circumvent this problem we'll now compile libpulse with -z nodelete,
    to make it unnecessary to delete the TLS data ever and thus avoiding the
    problem. It's suboptimal, but for now I see no better solution.

diff --git a/src/Makefile.am b/src/Makefile.am
index 5ed0f6f..b9d0083 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,7 +69,7 @@ AM_CFLAGS = \
 
 AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
 AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
-AM_LDFLAGS =
+AM_LDFLAGS = -Wl,-z,nodelete
 
 if STATIC_BINS
 BINLDFLAGS = -static

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list