[tracker/fixed-cursor] Revert "tracker-store: Add locks for dbus access"



commit 59c9af976824a4234c0bac8760e95bdea0ef517d
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Apr 26 16:27:06 2010 +0200

    Revert "tracker-store: Add locks for dbus access"
    
    This reverts commit 04d0102d85f8026600590f2104dcf062f23c0257.

 src/tracker-store/tracker-resources.c |   61 ++------------------------------
 1 files changed, 4 insertions(+), 57 deletions(-)
---
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index 2d0a195..c909602 100644
--- a/src/tracker-store/tracker-resources.c
+++ b/src/tracker-store/tracker-resources.c
@@ -46,8 +46,6 @@
 #define RDF_PREFIX TRACKER_RDF_PREFIX
 #define RDF_TYPE RDF_PREFIX "type"
 
-static GStaticMutex tracker_dbus_mutex = G_STATIC_MUTEX_INIT;
-
 /* I *know* that this is some arbitrary number that doesn't seem to
  * resemble anything. In fact it's what I experimentally measured to
  * be a good value on a default Debian testing which has
@@ -167,21 +165,13 @@ turtle_import_callback (GError *error, gpointer user_data)
 		                             info->context,
 		                             &error,
 		                             NULL);
-
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		dbus_g_method_return_error (info->context, error);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
-
 		return;
 	}
 
 	tracker_dbus_request_success (info->request_id,
 	                              info->context);
-
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	dbus_g_method_return (info->context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 }
 
 void
@@ -228,21 +218,14 @@ query_callback (gpointer inthread_data, GError *error, gpointer user_data)
 		                             info->context,
 		                             &ptr->error,
 		                             NULL);
-
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		dbus_g_method_return_error (info->context, ptr->error);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
-
 		g_error_free (ptr->error);
 	} else {
 
 		tracker_dbus_request_success (info->request_id,
 		                              info->context);
 
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		dbus_g_method_send_reply (info->context, ptr->reply);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
-
 	}
 
 	g_slice_free (InThreadPtr, ptr);
@@ -259,14 +242,16 @@ query_inthread (TrackerDBCursor *cursor, GError *error, gpointer user_data)
 	GError *loop_error = NULL;
 	guint length = 0;
 	gboolean cont;
+	static GStaticMutex dbus_mutex = G_STATIC_MUTEX_INIT;
 
 	if (error) {
 		ptr->error = g_error_copy (error);
 		return ptr;
 	}
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
+	g_static_mutex_lock (&dbus_mutex);
 	reply = dbus_g_method_get_reply (info->context);
+	g_static_mutex_unlock (&dbus_mutex);
 
 	dbus_message_iter_init_append (reply, &iter);
 
@@ -317,8 +302,6 @@ query_inthread (TrackerDBCursor *cursor, GError *error, gpointer user_data)
 
 	dbus_message_iter_close_container (&iter, &rows_iter);
 
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 	if (loop_error) {
 		ptr->error = loop_error;
 		ptr->reply = NULL;
@@ -357,9 +340,7 @@ tracker_resources_sparql_query (TrackerResources         *self,
 	info->request_id = request_id;
 	info->context = context;
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	sender = dbus_g_method_get_sender (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
 
 	tracker_store_sparql_query (query, TRACKER_STORE_PRIORITY_HIGH,
 	                            query_inthread, query_callback, sender,
@@ -378,19 +359,13 @@ update_callback (GError *error, gpointer user_data)
 		                             info->context,
 		                             &error,
 		                             NULL);
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		dbus_g_method_return_error (info->context, error);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
 		return;
 	}
 
 	tracker_dbus_request_success (info->request_id,
 	                              info->context);
-
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	dbus_g_method_return (info->context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 }
 
 void
@@ -421,9 +396,7 @@ tracker_resources_sparql_update (TrackerResources        *self,
 	info->request_id = request_id;
 	info->context = context;
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	sender = dbus_g_method_get_sender (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
 
 	tracker_store_sparql_update (update, TRACKER_STORE_PRIORITY_HIGH, FALSE,
 	                             update_callback, sender,
@@ -442,21 +415,13 @@ update_blank_callback (GPtrArray *blank_nodes, GError *error, gpointer user_data
 		                             info->context,
 		                             &error,
 		                             NULL);
-
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		dbus_g_method_return_error (info->context, error);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
-
 		return;
 	}
 
 	tracker_dbus_request_success (info->request_id,
 	                              info->context);
-
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	dbus_g_method_return (info->context, blank_nodes);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 }
 
 void
@@ -487,9 +452,7 @@ tracker_resources_sparql_update_blank (TrackerResources       *self,
 	info->request_id = request_id;
 	info->context = context;
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	sender = dbus_g_method_get_sender (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
 
 	tracker_store_sparql_update_blank (update, TRACKER_STORE_PRIORITY_HIGH,
 	                                   update_blank_callback, sender,
@@ -515,11 +478,7 @@ tracker_resources_sync (TrackerResources        *self,
 	tracker_data_sync ();
 
 	tracker_dbus_request_success (request_id, context);
-
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	dbus_g_method_return (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 }
 
 void
@@ -550,9 +509,7 @@ tracker_resources_batch_sparql_update (TrackerResources          *self,
 	info->request_id = request_id;
 	info->context = context;
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	sender = dbus_g_method_get_sender (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
 
 	tracker_store_sparql_update (update, TRACKER_STORE_PRIORITY_LOW, TRUE,
 	                             update_callback, sender,
@@ -571,10 +528,7 @@ batch_commit_callback (gpointer user_data)
 	tracker_dbus_request_success (info->request_id,
 	                              info->context);
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	dbus_g_method_return (info->context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
-
 }
 
 void
@@ -601,9 +555,7 @@ tracker_resources_batch_commit (TrackerResources         *self,
 	info->request_id = request_id;
 	info->context = context;
 
-	g_static_mutex_lock (&tracker_dbus_mutex);
 	sender = dbus_g_method_get_sender (context);
-	g_static_mutex_unlock (&tracker_dbus_mutex);
 
 	tracker_store_queue_commit (batch_commit_callback, sender, info,
 	                            destroy_method_info);
@@ -657,11 +609,7 @@ on_statements_committed (gpointer user_data)
 
 			while (g_hash_table_iter_next (&iter, &key, &value)) {
 				TrackerResourceClass *class_ = key;
-
-				g_static_mutex_lock (&tracker_dbus_mutex);
 				tracker_resource_class_emit_events (class_);
-				g_static_mutex_unlock (&tracker_dbus_mutex);
-
 			}
 
 			g_hash_table_destroy (to_emit);
@@ -674,9 +622,8 @@ on_statements_committed (gpointer user_data)
 	writebacks = tracker_writeback_get_pending ();
 
 	if (writebacks) {
-		g_static_mutex_lock (&tracker_dbus_mutex);
 		g_signal_emit (resources, signals[WRITEBACK], 0, writebacks);
-		g_static_mutex_unlock (&tracker_dbus_mutex);
+
 	}
 
 	tracker_writeback_reset ();



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