summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2023-04-28 10:52:22 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2023-04-28 10:52:22 +0100
commite7398198c5d559c1d88b48b7a02e1320919534a7 (patch)
tree7dd5710a8c0da807ead9f09a13f08d50c818ace9
parent9b8369852b1de635124c97a7b15c987a9c9768b1 (diff)
downloadglib-e7398198c5d559c1d88b48b7a02e1320919534a7.tar.gz
gthreadpool: Document that g_thread_pool_new() will spawn a thread
Otherwise it might look like it would only start spawning threads when jobs are enqueued. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2958
-rw-r--r--glib/gthreadpool.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/glib/gthreadpool.c b/glib/gthreadpool.c
index 54e49b3c0..c18de89d0 100644
--- a/glib/gthreadpool.c
+++ b/glib/gthreadpool.c
@@ -536,10 +536,14 @@ g_thread_pool_start_thread (GRealThreadPool *pool,
* since their threads are never considered idle and returned to the
* global pool.
*
- * Note that the threads used by exclusive threadpools will all inherit the
+ * Note that the threads used by exclusive thread pools will all inherit the
* scheduler settings of the current thread while the threads used by
- * non-exclusive threadpools will inherit the scheduler settings from the
- * first thread that created such a threadpool.
+ * non-exclusive thread pools will inherit the scheduler settings from the
+ * first thread that created such a thread pool.
+ *
+ * At least one thread will be spawned when this function is called, either to
+ * create the @max_threads exclusive threads, or to preserve the scheduler
+ * settings of the current thread for future spawns.
*
* @error can be %NULL to ignore errors, or non-%NULL to report
* errors. An error can only occur when @exclusive is set to %TRUE