summaryrefslogtreecommitdiff
path: root/glib/gasyncqueue.c
diff options
context:
space:
mode:
authorMartyn James Russell <mr@src.gnome.org>2006-04-07 09:23:42 +0000
committerMartyn James Russell <mr@src.gnome.org>2006-04-07 09:23:42 +0000
commit6c6f17133dbdd47cfa7b6567e6a669bb210b55a2 (patch)
tree590087e088b403ce4ea185afc2abad19d5f226ba /glib/gasyncqueue.c
parent49cc2e2396a6f5cc554d6ebcdf37682942e0c4d8 (diff)
downloadglib-6c6f17133dbdd47cfa7b6567e6a669bb210b55a2.tar.gz
Make sure g_thread_pool_stop_unused_threads() actually stops unused
* glib/gthreadpool.c: Make sure g_thread_pool_stop_unused_threads() actually stops unused threads and global limits (like max idle time and max unused threads) can be set without creating a thread pool first. Fixed #335215 (patch from Chris Wilson). * tests/threadpool-test.c: Added two new tests, tests setting global limits before creating a thread pool. The second test makes sure unused threads are actually stopped when using the g_thread_pool_stop_unused_threads().
Diffstat (limited to 'glib/gasyncqueue.c')
-rw-r--r--glib/gasyncqueue.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/glib/gasyncqueue.c b/glib/gasyncqueue.c
index 8d6f3f295..646efd261 100644
--- a/glib/gasyncqueue.c
+++ b/glib/gasyncqueue.c
@@ -625,5 +625,18 @@ g_async_queue_sort_unlocked (GAsyncQueue *queue,
&sd);
}
+/*
+ * Private API
+ */
+
+GMutex*
+_g_async_queue_get_mutex (GAsyncQueue* queue)
+{
+ g_return_val_if_fail (queue, NULL);
+ g_return_val_if_fail (g_atomic_int_get (&queue->ref_count) > 0, NULL);
+
+ return queue->mutex;
+}
+
#define __G_ASYNCQUEUE_C__
#include "galiasdef.c"