gallium/util: Clarify comment in util_init_thread_pinning
[mesa.git] / src / gallium / auxiliary / util / u_helpers.c
index b6cebf96329d16de6c914e00dccca04b29d27a49..4c70c004178b36bbc8973ae0fad882b1b6611186 100644 (file)
@@ -148,7 +148,10 @@ util_init_thread_pinning(void)
    /* Reset thread affinity for all child processes to prevent them from
     * inheriting the current thread's affinity.
     *
-    * What happens if a driver is unloaded and the app creates a thread?
+    * XXX: If the driver is unloaded after this, and the app later calls
+    * fork(), the child process will likely crash before fork() returns,
+    * because the address where util_set_full_cpu_affinity was located
+    * will either be unmapped or point to random other contents.
     */
    pthread_atfork(NULL, NULL, util_set_full_cpu_affinity);
 }