[glib] gtask: Ignore errors from g_thread_pool_push()



commit f41ebebd3476e3e6887f11ed26672a39513c4f98
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Fri Sep 19 08:54:33 2014 +0100

    gtask: Ignore errors from g_thread_pool_push()
    
    g_thread_pool_push() only returns an error if it fails to spawn a new
    thread. However, it unconditionally adds the task to its worker queue,
    so:
     • if _any_ threads exist in the pool, the task will eventually be
       handled; and
     • if _no_ threads exist in the pool, the task will be handled if one
       is eventually successfully spawned.
    If no more threads are ever spawned, the process probably has bigger
    problems than a single GTask which is taking forever to complete.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736806

 gio/gtask.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gio/gtask.c b/gio/gtask.c
index cc8de9b..51259bd 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -1288,10 +1288,8 @@ g_task_start_task_thread (GTask           *task,
                              task_thread_cancelled_disconnect_notify, 0);
     }
 
-  g_thread_pool_push (task_pool, g_object_ref (task), &task->error);
-  if (task->error)
-    task->thread_complete = TRUE;
-  else if (g_private_get (&task_private))
+  g_thread_pool_push (task_pool, g_object_ref (task), NULL);
+  if (g_private_get (&task_private))
     {
       /* This thread is being spawned from another GTask thread, so
        * bump up max-threads so we don't starve.


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