[glib] gthreadpool: Don't pass bad data to GThreadPool sorter
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gthreadpool: Don't pass bad data to GThreadPool sorter
- Date: Mon, 11 Nov 2013 07:00:11 +0000 (UTC)
commit dce83add1800c7145d6375626e2129fc51a83267
Author: Stef Walter <stefw gnome org>
Date: Sun Nov 10 00:15:30 2013 +0100
gthreadpool: Don't pass bad data to GThreadPool sorter
This causes sorters to crash.
https://bugzilla.gnome.org/show_bug.cgi?id=711756
glib/gthreadpool.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/glib/gthreadpool.c b/glib/gthreadpool.c
index 78684ab..a122d8d 100644
--- a/glib/gthreadpool.c
+++ b/glib/gthreadpool.c
@@ -818,8 +818,14 @@ g_thread_pool_wakeup_and_stop_all (GRealThreadPool *pool)
pool->immediate = TRUE;
+ /*
+ * So here we're sending bogus data to the pool threads, which
+ * should cause them each to wake up, and check the above
+ * pool->immediate condition. However we don't want that
+ * data to be sorted (since it'll crash the sorter).
+ */
for (i = 0; i < pool->num_threads; i++)
- g_thread_pool_queue_push_unlocked (pool, GUINT_TO_POINTER (1));
+ g_async_queue_push_unlocked (pool->queue, GUINT_TO_POINTER (1));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]