- Edited
I have two segments of code in a node's script that are executed in response to different signals. Since one of the code segments uses queue_free() to delete the node, I use a Mutex to make the two segments exclusive.
Each section of code is bracketed by: mutex.lock() ... mutex.unlock()
One of the bracketed code sections contains a yield:
yield(get_tree().create_timer(0.25), "timeout")
The yield appears to "break" the mutex. The statement after the yield sometimes fails to work because the other segment of code executes, even though the locked mutex should prevent that from happening.
Is this the expected behavior?