[evolution-data-server] Revert part of commit 687d1b1bcb to avoid deadlock



commit 9d07508c073ee11cf7e050bb54d8ea68f2c3e748
Author: Milan Crha <mcrha redhat com>
Date:   Tue Mar 3 19:37:55 2015 +0100

    Revert part of commit 687d1b1bcb to avoid deadlock
    
    There could happen a deadlock in the code due to this new lock
    addition, thus betetr to remove it for now and wait for bug 745545.

 camel/providers/imapx/camel-imapx-server.c |   23 ++---------------------
 camel/providers/imapx/camel-imapx-server.h |    2 +-
 camel/providers/imapx/camel-imapx-store.c  |   20 --------------------
 camel/providers/imapx/camel-imapx-store.h  |    4 ----
 4 files changed, 3 insertions(+), 46 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 1d59f02..118e73e 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -55,27 +55,8 @@
 #define c(...) camel_imapx_debug(command, __VA_ARGS__)
 #define e(...) camel_imapx_debug(extra, __VA_ARGS__)
 
-#define QUEUE_LOCK(x) G_STMT_START { \
-       CamelIMAPXStore *imapx_store = camel_imapx_server_ref_store ((x)); \
-       \
-       if (imapx_store) { \
-               camel_imapx_store_job_queue_lock (imapx_store); \
-               g_object_unref (imapx_store); \
-       } \
-       \
-       g_rec_mutex_lock (&(x)->queue_lock); \
-       } G_STMT_END
-
-#define QUEUE_UNLOCK(x) G_STMT_START { \
-       CamelIMAPXStore *imapx_store = camel_imapx_server_ref_store ((x)); \
-       \
-       g_rec_mutex_unlock (&(x)->queue_lock); \
-       \
-       if (imapx_store) { \
-               camel_imapx_store_job_queue_unlock (imapx_store); \
-               g_object_unref (imapx_store); \
-       } \
-       } G_STMT_END
+#define QUEUE_LOCK(x) g_rec_mutex_lock (&(x)->queue_lock)
+#define QUEUE_UNLOCK(x) g_rec_mutex_unlock (&(x)->queue_lock)
 
 /* Try pipelining fetch requests, 'in bits' */
 #define MULTI_SIZE (32768 * 8)
diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index b7b876a..448b813 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -118,7 +118,7 @@ struct _CamelIMAPXServer {
 
        /* Current command/work queue.  All commands are stored in one list,
         * all the time, so they can be cleaned up in exception cases */
-       GRecMutex queue_lock; /* use in combination with camel_imapx_store_job_queue_lock()/_unlock() */
+       GRecMutex queue_lock;
        CamelIMAPXCommand *literal;
        CamelIMAPXCommandQueue *queue;
        CamelIMAPXCommandQueue *active;
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index 13111b6..f6700b7 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -64,8 +64,6 @@ struct _CamelIMAPXStorePrivate {
        CamelIMAPXServer *connecting_server;
        gboolean is_concurrent_connection;
 
-       GRecMutex job_queue_lock;
-
        GMutex server_lock;
 
        GHashTable *quota_info;
@@ -705,7 +703,6 @@ imapx_store_finalize (GObject *object)
 
        priv = CAMEL_IMAPX_STORE_GET_PRIVATE (object);
 
-       g_rec_mutex_clear (&priv->job_queue_lock);
        g_mutex_clear (&priv->get_finfo_lock);
        g_mutex_clear (&priv->server_lock);
 
@@ -2671,7 +2668,6 @@ camel_imapx_store_init (CamelIMAPXStore *store)
 
        store->priv->con_man = camel_imapx_conn_manager_new (CAMEL_STORE (store));
 
-       g_rec_mutex_init (&store->priv->job_queue_lock);
        g_mutex_init (&store->priv->get_finfo_lock);
 
        g_mutex_init (&store->priv->namespaces_lock);
@@ -3466,22 +3462,6 @@ camel_imapx_store_ref_job (CamelIMAPXStore *imapx_store,
        return job;
 }
 
-void
-camel_imapx_store_job_queue_lock (CamelIMAPXStore *imapx_store)
-{
-       g_return_if_fail (CAMEL_IS_IMAPX_STORE (imapx_store));
-
-       g_rec_mutex_lock (&imapx_store->priv->job_queue_lock);
-}
-
-void
-camel_imapx_store_job_queue_unlock (CamelIMAPXStore *imapx_store)
-{
-       g_return_if_fail (CAMEL_IS_IMAPX_STORE (imapx_store));
-
-       g_rec_mutex_unlock (&imapx_store->priv->job_queue_lock);
-}
-
 /* for debugging purposes only */
 void
 camel_imapx_store_dump_queue_status (CamelIMAPXStore *imapx_store)
diff --git a/camel/providers/imapx/camel-imapx-store.h b/camel/providers/imapx/camel-imapx-store.h
index b5e07d6..f1311c2 100644
--- a/camel/providers/imapx/camel-imapx-store.h
+++ b/camel/providers/imapx/camel-imapx-store.h
@@ -131,10 +131,6 @@ struct _CamelIMAPXJob *
                                                 CamelIMAPXMailbox *mailbox,
                                                 guint32 job_type,
                                                 const gchar *uid);
-void           camel_imapx_store_job_queue_lock
-                                               (CamelIMAPXStore *imapx_store);
-void           camel_imapx_store_job_queue_unlock
-                                               (CamelIMAPXStore *imapx_store);
 
 /* for debugging purposes only */
 void           camel_imapx_store_dump_queue_status


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