[geary/geary-0.6] Prevent AccountSynchronizer from deadlock



commit a1968eaa9725e0f9bb185581482d58b0c69cf004
Author: Jim Nelson <jim yorba org>
Date:   Wed Jun 11 17:27:14 2014 -0700

    Prevent AccountSynchronizer from deadlock
    
    Occassionally the EmailPrefetcher would not signal its work was
    completed, causing the AccountSynchronizer to deadlock (it waits
    until the EmailPrefetcher completes before closing the Folder and
    moving on to the next one).  The problem was due to the
    EmailPrefetcher not clearing a timeout id, making other code think
    other work was outstanding when it was in fact completed.

 .../imap-engine/imap-engine-email-prefetcher.vala  |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-email-prefetcher.vala 
b/src/engine/imap-engine/imap-engine-email-prefetcher.vala
index f20cd7c..4df5374 100644
--- a/src/engine/imap-engine/imap-engine-email-prefetcher.vala
+++ b/src/engine/imap-engine/imap-engine-email-prefetcher.vala
@@ -101,15 +101,12 @@ private class Geary.ImapEngine.EmailPrefetcher : Object {
         else
             active_sem.acquire();
         
-        schedule_id = Timeout.add_seconds(start_delay_sec, on_start_prefetch);
-    }
-    
-    private bool on_start_prefetch() {
-        do_prefetch_async.begin();
-        
-        schedule_id = 0;
-        
-        return false;
+        schedule_id = Timeout.add_seconds(start_delay_sec, () => {
+            schedule_id = 0;
+            do_prefetch_async.begin();
+            
+            return false;
+        });
     }
     
     private async void do_prepare_all_local_async() {


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