}
static void
-test_thread_idle_time ()
+test_thread_idle_time (void)
{
guint limit = 50;
guint interval = 10000;
idle_pool = g_thread_pool_new (test_thread_idle_time_entry_func,
NULL,
- MAX_THREADS,
+ 0,
FALSE,
NULL);
+ g_thread_pool_set_max_threads (idle_pool, MAX_THREADS, NULL);
g_thread_pool_set_max_unused_threads (MAX_UNUSED_THREADS);
g_thread_pool_set_max_idle_time (interval);
+ g_assert (g_thread_pool_get_max_threads (idle_pool) == MAX_THREADS);
g_assert (g_thread_pool_get_max_unused_threads () == MAX_UNUSED_THREADS);
g_assert (g_thread_pool_get_max_idle_time () == interval);
g_thread_pool_unprocessed (idle_pool)));
}
+ g_assert_cmpint (g_thread_pool_unprocessed (idle_pool), <=, limit);
+
g_timeout_add ((interval - 1000),
test_thread_idle_timeout,
GUINT_TO_POINTER (interval));