[glib/wip/gcleanup: 50/79] gthreadpool: Don't pass bad data to GThreadPool sorter
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup: 50/79] gthreadpool: Don't pass bad data to GThreadPool sorter
- Date: Sun, 10 Nov 2013 15:23:43 +0000 (UTC)
commit 634eb25f190a6715f8d3aca0960dd99573dc4a99
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..d9d6d1f 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->imediate 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]