[libgda] Locking correction for ITSignaler



commit 9cd61278733239ef153140d18328ed6825582f9b
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Sep 7 21:02:41 2014 +0200

    Locking correction for ITSignaler

 libgda/thread-wrapper/itsignaler.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/libgda/thread-wrapper/itsignaler.c b/libgda/thread-wrapper/itsignaler.c
index e4db446..260206d 100644
--- a/libgda/thread-wrapper/itsignaler.c
+++ b/libgda/thread-wrapper/itsignaler.c
@@ -211,6 +211,9 @@ itsignaler_reset (ITSignaler *its)
 }
 #endif
 
+/*
+ * This function requires that @its be locked using itsignaler_lock()
+ */
 static void
 itsignaler_free (ITSignaler *its)
 {
@@ -244,21 +247,17 @@ _itsignaler_unref (ITSignaler *its, gboolean give_to_bg)
        g_print ("[I] ITSignaler %p --: %u\n", its, its->ref_count);
 #endif
        if (its->ref_count == 0) {
-               itsignaler_unlock (its);
-
 #ifndef NOBG
                /* destroy or store as spare */
                if (!its->broken && give_to_bg) {
                        itsignaler_reset (its);
                        its->ref_count++;
                        bg_set_spare_its (its);
-               }
-               else {
                        itsignaler_unlock (its);
-                       itsignaler_free (its);
                }
+               else
+                       itsignaler_free (its);
 #else
-               itsignaler_unlock (its);
                itsignaler_free (its);
 #endif
        }


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