[evolution-data-server/evolution-data-server-3-12] Bug 730788 - [IMAPx] Deadlock during IDLE start



commit 920750e8935af20bb9d94f715a590da598a1d882
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 27 11:11:22 2014 +0200

    Bug 730788 - [IMAPx] Deadlock during IDLE start

 camel/providers/imapx/camel-imapx-server.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index a3c4d1b..4a103bb 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -3554,16 +3554,20 @@ imapx_job_idle_start (CamelIMAPXJob *job,
        cp = g_queue_peek_head (&ic->parts);
        cp->type |= CAMEL_IMAPX_COMMAND_CONTINUATION;
 
-       QUEUE_LOCK (is);
        g_mutex_lock (&is->priv->idle_lock);
        /* Don't issue it if the idle was cancelled already */
        if (is->priv->idle_state == IMAPX_IDLE_PENDING) {
                is->priv->idle_state = IMAPX_IDLE_ISSUED;
+               g_mutex_unlock (&is->priv->idle_lock);
+
+               QUEUE_LOCK (is);
                imapx_command_start (is, ic);
        } else {
+               g_mutex_unlock (&is->priv->idle_lock);
+
+               QUEUE_LOCK (is);
                imapx_unregister_job (is, job);
        }
-       g_mutex_unlock (&is->priv->idle_lock);
        QUEUE_UNLOCK (is);
 
        camel_imapx_command_unref (ic);


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