g_thread_pool_set_sort_function (job_thread_pool,
g_io_job_compare,
NULL);
- /* It's kinda weird that this is a global setting
- * instead of per threadpool. However, we really
- * want to cache some threads, but not keep around
- * those threads forever. */
- g_thread_pool_set_max_idle_time (15 * 1000);
- g_thread_pool_set_max_unused_threads (2);
}
}
return NULL;
/* Here all unused threads are waiting */
static GAsyncQueue *unused_thread_queue = NULL;
static gint unused_threads = 0;
-static gint max_unused_threads = 0;
+static gint max_unused_threads = 2;
static gint kill_unused_threads = 0;
-static guint max_idle_time = 0;
+static guint max_idle_time = 15 * 1000;
static void g_thread_pool_queue_push_unlocked (GRealThreadPool *pool,
gpointer data);
* Sets the maximal number of unused threads to @max_threads.
* If @max_threads is -1, no limit is imposed on the number
* of unused threads.
+ *
+ * The default value is 2.
*/
void
g_thread_pool_set_max_unused_threads (gint max_threads)
*
* By setting @interval to 0, idle threads will not be stopped.
*
- * This function makes use of g_async_queue_timed_pop () using
- * @interval.
+ * The default value is 15000 (15 seconds).
*
* Since: 2.10
*/