mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
gallium/u_queue: fix a crash with atexit handlers
Commit4aea8fe("gallium/u_queue: fix random crashes when the app calls exit()") added a atexit handler which calls util_queue_killall_and_wait() for each queue to stop the threads. However the app is also free to use atexit handlers to clean up things, leading to util_queue_destroy() call which will also call util_queue_killall_and_wait() for the same queue again, causing threads being joined twice, and that is undefined. This happens with libglut, for example. A simple fix is to just set num_threads to 0 as there are no more valid threads after util_queue_killall_and_wait() returns. Fixes:4aea8fe"gallium/u_queue: fix random crashes when the app calls exit()" Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit9936121935)
This commit is contained in:
parent
21e3f2f24c
commit
6b8c9e115e
1 changed files with 1 additions and 0 deletions
|
|
@ -251,6 +251,7 @@ util_queue_killall_and_wait(struct util_queue *queue)
|
|||
|
||||
for (i = 0; i < queue->num_threads; i++)
|
||||
pipe_thread_wait(queue->threads[i]);
|
||||
queue->num_threads = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue