You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A thread will be deadlocked when executing Texture2D.get_image() if and only if the parent thread has called Thread.wait_to_finish() on the child thread.
I would expect the thread to execute as normal.
Steps to reproduce
spawn child thread
start execution of child
execute wait_to_finish() on the child thread
execute "get_image()" on a Texture2D in the child thread
The text was updated successfully, but these errors were encountered:
JohnPandich
changed the title
Deadlock on thread if "wait_to_finish" has been called on the parent thread.
Deadlock on thread if "wait_to_finish" has been called by the parent thread and child executes Texture2D.get_image()
Feb 27, 2023
Threads aren't implemented correctly #71408 and my changes that needed work so I closed #71097
Basically, they're detaching always in the destructor, so when the thread function returns, it detaches and cleans up automatically. This means you cannot call wait_to_finish on it (which is a join, btw). Joining a thread pauses the current thread's execution until the other thread is done.
Yes, it warns you must always call it, but good luck calling join on a detached and dead thread, which is an error, because it erroneously treats an invalid handle as the main thread, and you can't join the main thread from the main thread.
Godot version
v4.0.rc6
System information
Linux Mint, Forward+, ntel© Xeon© CPU E5-2650 v4 @ 2.20GHz × 12, 64gb ram
Issue description
A thread will be deadlocked when executing Texture2D.get_image() if and only if the parent thread has called Thread.wait_to_finish() on the child thread.
I would expect the thread to execute as normal.
Steps to reproduce
Minimal reproduction project
repro.zip
The text was updated successfully, but these errors were encountered: