mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
gallium/util: Clarify comment in util_init_thread_pinning
As discussed in the review of the patch which added the comment: Nothing happens when a thread is created, because pthread_atfork doesn't affect creating threads. However, spawning a child process will likely crash. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
3fb4adae83
commit
cb863de626
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue