[glib/wip/gcleanup] gtask: Cleanup thread pool
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup] gtask: Cleanup thread pool
- Date: Sun, 10 Nov 2013 21:36:37 +0000 (UTC)
commit 3658d89fde4c8e18327de07ee3732af32d1cd388
Author: Stef Walter <stefw gnome org>
Date: Thu Nov 7 23:02:05 2013 +0100
gtask: Cleanup thread pool
https://bugzilla.gnome.org/show_bug.cgi?id=711799
gio/gtask.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gio/gtask.c b/gio/gtask.c
index 3c7341b..0a62cd3 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -1801,12 +1801,18 @@ g_task_compare_priority (gconstpointer a,
}
static void
+g_task_thread_pool_cleanup (void)
+{
+ g_thread_pool_free (task_pool, TRUE, TRUE);
+}
+
+static void
g_task_thread_pool_init (void)
{
task_pool = g_thread_pool_new (g_task_thread_pool_thread, NULL,
10, FALSE, NULL);
g_assert (task_pool != NULL);
-
+ G_CLEANUP_FUNC (g_task_thread_pool_cleanup);
g_thread_pool_set_sort_function (task_pool, g_task_compare_priority, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]