[geary] Fix IDLE command not being cancelled if it has not yet been sent



commit 9365e8ee46a61cc25dc973c04e9146401273ff91
Author: Michael Gratton <mike vee net>
Date:   Wed Aug 14 07:34:42 2019 +1000

    Fix IDLE command not being cancelled if it has not yet been sent
    
    Using a spin lock meant that if an IDLE was cancelled while it was being
    sent it wouldn't actually be cancelled until something else came along.
    This would commonly cause a deadlock, since higher level code would be
    waiting for the command that was queued that caused the IDLE to be
    cancelled in the first place.

 src/engine/imap/command/imap-idle-command.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap/command/imap-idle-command.vala b/src/engine/imap/command/imap-idle-command.vala
index 2239838f..069bea5b 100644
--- a/src/engine/imap/command/imap-idle-command.vala
+++ b/src/engine/imap/command/imap-idle-command.vala
@@ -21,13 +21,13 @@ public class Geary.Imap.IdleCommand : Command {
     public bool idle_started { get; private set; default = false; }
 
     private bool serialised = false;
-    private Geary.Nonblocking.Spinlock? exit_lock;
+    private Geary.Nonblocking.Semaphore? exit_lock;
     private GLib.Cancellable? exit_cancellable = new GLib.Cancellable();
 
 
     public IdleCommand() {
         base(NAME);
-        this.exit_lock = new Geary.Nonblocking.Spinlock(this.exit_cancellable);
+        this.exit_lock = new Geary.Nonblocking.Semaphore(this.exit_cancellable);
     }
 
     /** Causes the idle command to exit, if currently executing. **/


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