mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 18:08:54 +02:00
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().
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user