[gnome-keyring/gnome-2-28] daemon: Fix deadlock in async code



commit c8faa0f700dc910f4c372f1c157e912ab92fe20b
Author: Stef Walter <stefw gnome org>
Date:   Tue Aug 21 14:45:50 2012 +0200

    daemon: Fix deadlock in async code
    
     * This occurred because gcc reordered the various atomic
       instructions in async_poll_func() during optimization.
     * Mark volatile to disable reordering optimizations involving
       those variables

 daemon/util/gkr-daemon-async.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/daemon/util/gkr-daemon-async.c b/daemon/util/gkr-daemon-async.c
index 207982d..ce25ca5 100644
--- a/daemon/util/gkr-daemon-async.c
+++ b/daemon/util/gkr-daemon-async.c
@@ -81,8 +81,8 @@ static GPollFunc orig_poll_func = NULL;		/* The system poll function, which we w
 static gint async_source_id = 0;              	/* Our GSource id for the main loop */
 static GQueue *done_queue = NULL;		/* The queue of completed worker threads */ 
 static GHashTable *running_workers = NULL;	/* A set of running worker threads */
-static gint waiting_on_lock = 0;		/* Number of threads waiting on lock */ 
-static gint waiting_on_poll = 0;		/* Whether we're waiting on the poll or not */
+static volatile gint waiting_on_lock = 0;	/* Number of threads waiting on lock */
+static volatile gint waiting_on_poll = 0;	/* Whether we're waiting on the poll or not */
 
 static void cleanup_done_threads (void);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]