[balsa/gtk3] Lock mutex before signalling cond



commit 90e7e124440206134b4262b28607f99f10d7a1b2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 13 15:29:30 2012 -0400

    Lock mutex before signalling cond
    
    	* src/balsa-app.c (find_url_idle_cb): lock mutex before
    	signalling cond.

 ChangeLog       |    5 +++++
 src/balsa-app.c |   11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0e81255..45f985f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-13  Peter Bloomfield
+
+	* src/balsa-app.c (find_url_idle_cb): lock mutex before
+	signalling cond.
+
 2012-06-12  Peter Bloomfield
 
 	* libbalsa/mailbox.c (lbm_message_expunged_cb),
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 771aa2c..ededebd 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -751,13 +751,22 @@ typedef struct {
 static gboolean
 find_url_idle_cb(BalsaFindUrlInfo * info)
 {
+#if GLIB_CHECK_VERSION(2, 32, 0)
+    g_mutex_lock(&info->mutex);
+
     info->mbnode = find_url(info->url);
     info->wait = FALSE;
 
-#if GLIB_CHECK_VERSION(2, 32, 0)
     g_cond_signal(&info->cond);
+    g_mutex_unlock(&info->mutex);
 #else                           /* GLIB_CHECK_VERSION(2, 32, 0) */
+    g_mutex_lock(info->mutex);
+
+    info->mbnode = find_url(info->url);
+    info->wait = FALSE;
+
     g_cond_signal(info->cond);
+    g_mutex_unlock(info->mutex);
 #endif                          /* GLIB_CHECK_VERSION(2, 32, 0) */
 
     return FALSE;



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