Files
godot/core
HP van Braam ae564feb2a Fix a deadlock in WorkerThreadPool
When the main thread is waiting on a worker thread pool via
WorkerThreadPool::wait_for_group_task_completion() the MessageQueue is no
longer being serviced.

But in ResourceLoader::_load_complete_inner we need to be able to push a
callable onto the MessageQueue and we wait until completion. Effectively
waiting on the main thread to run our code.

If the tasking waiting on completion is in the group the main thread is
waiting for then this can never happen.

We solve this problem by servicing the MessageQueue in the
WorkerThreadPool if main thread is waiting. To avoid busy waiting on the
semaphore we sleep for a very brief time to spare battery without impacting
latency too much in the waiting case.
2026-06-10 12:46:42 +02:00
..
2026-06-08 04:57:26 +02:00
2026-06-10 12:46:42 +02:00
2026-03-25 17:07:39 +03:00