Closed RandomShaper closed 5 months ago
"Deadlock" suggests that the lock is already held. What do the other threads' backtraces look like?
It's a deadlock in the sense that #234 describes:
Unfortunately if the main thread is currently blocking waiting for that surface create to finish you end up with a deadlock between the two threads.
Our main thread is waiting for the render thread (the one in the stack trace) to finish executing drawing, which can involve recreating swap chains. Only when that is done, message "pumping" will happen. Unfortunately, though, the rendering thread is waiting for the main thread to respond to the message. (Apologies if my Mac jargon is not very accurate since I'm not very familiar with its frameworks.)
I've made #2214, that fixes the issue for Godot.
In the Godot game engine, when rendering from a non-main thread, deadlock happen, similarly to what is described in #234.
This is the stack trace from the rendering thread at the point of deadlock (2024-04-23: updated with symbols):
At first, I thought it had been introduced by 90eb1af19f2351329d7025e8c121dda3fd7a15ca, but I get the same issue with 1.3.275.
The OS surface is being created via
VK_EXT_METAL_SURFACE_EXTENSION
.