From 3b9fc716449302c7805b34cae0dde9a88fd99e57 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 28 Apr 2023 11:00:33 +0100 Subject: [PATCH] docs: Mention that calls after fork() must be async-signal-safe Signed-off-by: Philip Withnall Helps: #2958 --- docs/reference/glib/programming.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/reference/glib/programming.xml b/docs/reference/glib/programming.xml index 52df907e8..e4cda4cec 100644 --- a/docs/reference/glib/programming.xml +++ b/docs/reference/glib/programming.xml @@ -34,9 +34,16 @@ GLib creates a worker thread for its own purposes so GLib applications will always have at least 2 threads. + +In particular, this means that programs must only use +async-signal-safe functions between +calling fork() and exec(), even if +they haven’t explicitly spawned another thread yet. + + See the sections on threads and -threadpools for GLib APIs that +thread pools for GLib APIs that support multithreaded applications.