[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, stable-queue, updated. v0.9.21-21-g366e6d7

Colin Guthrie gitmailer-noreply at 0pointer.de
Thu Jan 14 10:48:36 PST 2010


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 stable-queue branch has been updated
      from  48e0f6808bcc8e07622e4a45b3aabfc4679e9966 (commit)

- Log -----------------------------------------------------------------
366e6d7 Mark shared variables as volatile
-----------------------------------------------------------------------

Summary of changes:
 src/pulse/thread-mainloop.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

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

commit 366e6d7e90d3bebc98a1af3cfb04b4cfc8cff6f5
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Sun Dec 6 12:20:53 2009 +0530

    Mark shared variables as volatile
    
    'n_waiting' and 'n_waiting_for_accept' may be accessed from mulitple
    threads, and thus need to be marked as volatile to suppres certain
    compiler optimisations. All uses are protected by a mutex, so we don't
    need to worry about cache issues (added documentation for this as well).
    
    This addresses bug #738.

diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index a2b98ce..14ed926 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -51,7 +51,7 @@
 
 struct pa_threaded_mainloop {
     pa_mainloop *real_mainloop;
-    int n_waiting, n_waiting_for_accept;
+    volatile int n_waiting, n_waiting_for_accept;
 
     pa_thread* thread;
     pa_mutex* mutex;
@@ -185,6 +185,7 @@ void pa_threaded_mainloop_unlock(pa_threaded_mainloop *m) {
     pa_mutex_unlock(m->mutex);
 }
 
+/* Called with the lock taken */
 void pa_threaded_mainloop_signal(pa_threaded_mainloop *m, int wait_for_accept) {
     pa_assert(m);
 
@@ -198,6 +199,7 @@ void pa_threaded_mainloop_signal(pa_threaded_mainloop *m, int wait_for_accept) {
     }
 }
 
+/* Called with the lock taken */
 void pa_threaded_mainloop_wait(pa_threaded_mainloop *m) {
     pa_assert(m);
 
@@ -212,6 +214,7 @@ void pa_threaded_mainloop_wait(pa_threaded_mainloop *m) {
     m->n_waiting --;
 }
 
+/* Called with the lock taken */
 void pa_threaded_mainloop_accept(pa_threaded_mainloop *m) {
     pa_assert(m);
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list