[shotwell/wip/import-stall] Potential fix for Dougie Nisbet's import stall bug



commit 865bd9f5381d82208c70f477b5f76b9f6693a52c
Author: Jim Nelson <jim yorba org>
Date:   Tue Oct 7 18:50:40 2014 -0700

    Potential fix for Dougie Nisbet's import stall bug

 src/BatchImport.vala           |    2 --
 src/threads/BackgroundJob.vala |    8 +-------
 2 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/src/BatchImport.vala b/src/BatchImport.vala
index d4298ed..7fcc419 100644
--- a/src/BatchImport.vala
+++ b/src/BatchImport.vala
@@ -1678,8 +1678,6 @@ private class PrepareFilesJob : BackgroundImportJob {
         library_dir = AppDirs.get_import_dir();
         fail_every = get_test_variable("SHOTWELL_FAIL_EVERY");
         skip_every = get_test_variable("SHOTWELL_SKIP_EVERY");
-        
-        set_notification_priority(Priority.LOW);
     }
     
     private static int get_test_variable(string name) {
diff --git a/src/threads/BackgroundJob.vala b/src/threads/BackgroundJob.vala
index 178211e..9efd960 100644
--- a/src/threads/BackgroundJob.vala
+++ b/src/threads/BackgroundJob.vala
@@ -108,7 +108,6 @@ public abstract class BackgroundJob {
     // controlled way (to avoid locking up the UI, for example).  This has ramifications about
     // the order in which completion and notifications arrive (see above note).
     private int completion_priority = Priority.HIGH;
-    private int notification_priority = Priority.DEFAULT_IDLE;
     
     public BackgroundJob(Object? owner = null, CompletionCallback? callback = null,
         Cancellable? cancellable = null, CancellationCallback? cancellation = null,
@@ -141,11 +140,6 @@ public abstract class BackgroundJob {
         completion_priority = priority;
     }
     
-    // This method is not thread-safe.  Best to set priority before the job is enqueued.
-    public void set_notification_priority(int priority) {
-        notification_priority = priority;
-    }
-    
     // This method is thread-safe, but only waits if a completion semaphore has been set, otherwise
     // exits immediately.  Note that blocking for a semaphore does NOT spin the event loop, so a
     // thread relying on it to continue should not use this.
@@ -211,7 +205,7 @@ public abstract class BackgroundJob {
             notify_queue.add(new NotificationJob(callback, this, user));
         }
         
-        Idle.add_full(notification_priority, on_notification_ready);
+        Idle.add(on_notification_ready);
         
         // If an interlocked notification, block until the main thread completes the notification
         // callback


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