[glib] task: avoid context lock when setting source name



commit d95030a2fd1f4abb8dad623bdf7962fa902df8d6
Author: Christian Hergert <christian hergert me>
Date:   Sat Apr 30 15:09:43 2016 -0700

    task: avoid context lock when setting source name
    
    If you set the source name after attaching to the context, you have to
    lock the context to free/assign the new source name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765861

 gio/gtask.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gtask.c b/gio/gtask.c
index 0318d97..5a1cfab 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -1170,8 +1170,8 @@ g_task_return (GTask           *task,
 
   /* Otherwise, complete in the next iteration */
   source = g_idle_source_new ();
-  g_task_attach_source (task, source, complete_in_idle_cb);
   g_source_set_name (source, "[gio] complete_in_idle_cb");
+  g_task_attach_source (task, source, complete_in_idle_cb);
   g_source_unref (source);
 }
 


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