[tracker/tracker-0.8] plugins/evolution: Fixed a race condition, added a lock for it



commit 805e1f1b89a4861651050c426ab8dbb64c45c683
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Apr 28 11:33:38 2010 +0200

    plugins/evolution: Fixed a race condition, added a lock for it

 src/plugins/evolution/tracker-evolution-plugin.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index 5094889..e86cbdd 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -448,9 +448,11 @@ thread_pool_new (GFunc func, GFunc freeup, GCompareDataFunc sorter)
 static void
 thread_pool_push (ThreadPool *pool, gpointer item, gpointer user_data)
 {
+	g_mutex_lock (pool->mutex);
 	pool->items = g_list_prepend (pool->items, item);
 	if (!pool->dying)
 		g_thread_pool_push (pool->pool, item, user_data);
+	g_mutex_unlock (pool->mutex);
 }
 
 static gpointer



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