[libdazzle] task-cache: avoid race in cancellation state



commit e87d36d46f9e0e1b964a8e17e374e9b447347bd5
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 4 17:32:56 2017 -0700

    task-cache: avoid race in cancellation state
    
    If the item was already removed from the cache, we would have
    nothing to cancel. That can happen when racing to cancel things.

 src/cache/dzl-task-cache.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/cache/dzl-task-cache.c b/src/cache/dzl-task-cache.c
index c5f98f6..60237f7 100644
--- a/src/cache/dzl-task-cache.c
+++ b/src/cache/dzl-task-cache.c
@@ -484,9 +484,9 @@ dzl_task_cache_cancel_in_idle (gpointer user_data)
               g_cancellable_cancel (fetch_cancellable);
             }
         }
-    }
 
-  g_return_val_if_fail (cancelled, G_SOURCE_REMOVE);
+      g_return_val_if_fail (cancelled, G_SOURCE_REMOVE);
+    }
 
   return G_SOURCE_REMOVE;
 }


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