[gnome-keyring] [pkcs11] Shutdown module timer when holding proper mutex.



commit 78c999bd8588cf2d94acea01a842d1a4a5e6c3c1
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Nov 30 00:36:41 2010 +0000

    [pkcs11] Shutdown module timer when holding proper mutex.

 pkcs11/gkm/gkm-timer.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/pkcs11/gkm/gkm-timer.c b/pkcs11/gkm/gkm-timer.c
index 1368de5..bde8ce1 100644
--- a/pkcs11/gkm/gkm-timer.c
+++ b/pkcs11/gkm/gkm-timer.c
@@ -131,9 +131,14 @@ gkm_timer_shutdown (void)
 	GkmTimer *timer;
 
 	if (g_atomic_int_dec_and_test (&timer_refs)) {
-		timer_run = FALSE;
-		g_assert (timer_cond);
-		g_cond_broadcast (timer_cond);
+
+		g_static_mutex_lock (&timer_mutex);
+
+			timer_run = FALSE;
+			g_assert (timer_cond);
+			g_cond_broadcast (timer_cond);
+
+		g_static_mutex_unlock (&timer_mutex);
 
 		g_assert (timer_thread);
 		g_thread_join (timer_thread);



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