[glib: 3/4] kqueue: Use the worker context to schedule rescanning of missing files



commit e714e1e951844ec7366417f082d017b32ac7927b
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Sun Jun 17 09:48:34 2018 +0800

    kqueue: Use the worker context to schedule rescanning of missing files
    
    This makes it consistent with the file monitor itself, which already
    attaches kqueue event sources to the worker context.

 gio/kqueue/kqueue-missing.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gio/kqueue/kqueue-missing.c b/gio/kqueue/kqueue-missing.c
index a08f3a736..37af82e5b 100644
--- a/gio/kqueue/kqueue-missing.c
+++ b/gio/kqueue/kqueue-missing.c
@@ -66,8 +66,12 @@ _km_add_missing (kqueue_sub *sub)
 
   if (!scan_missing_running)
     {
+      GSource *source;
       scan_missing_running = TRUE;
-      g_timeout_add_seconds (SCAN_MISSING_TIME, km_scan_missing, NULL);
+      source = g_timeout_source_new_seconds (SCAN_MISSING_TIME);
+      g_source_set_callback (source, _km_scan_missing_cb, NULL, NULL);
+      g_source_attach (source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
+      g_source_unref (source);
     }
 }
 


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