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
I have encountered this while doing reimports of some assets.
The method ScriptLanguageExtension::frame will be called for every frame in the main loop. In parallel, the engine might call ScriptLanguageExtension::handles_global_class_type from the import thread, which will cause a panic as frame is &mut self.
The quickest workaround is to not implement ScriptLanguageExtension::frame.
The text was updated successfully, but these errors were encountered:
The method ScriptLanguageExtension::frame will be called for every frame in the main loop. In parallel, the engine might call ScriptLanguageExtension::handles_global_class_type from the import thread, which will cause a panic as frame is &mut self.
Or maybe expose it without binding &mut self, similar to #[func(gd_self)] in other places?
@Bromeon this is certainly an option but if someone wants to perform mutable operations in fn frame() it would still panic in certain situations due to another thread holding an immutable reference.
I think (at least with experimental-threads) access to the class instance storage should block instead of panic.
@Bromeon unfortunately the changes to ScriptInstance are completely unrelated to this.
Godot (particularly the editor) accesses ScriptLanguage singletons across multiple threads. Since GdCell panics on the second mutable borrow, this is an issue. It would be more ergonomic if GdCell would block the other thread until it becomes available instead of panicking.
I have encountered this while doing reimports of some assets.
The method
ScriptLanguageExtension::frame
will be called for every frame in the main loop. In parallel, the engine might callScriptLanguageExtension::handles_global_class_type
from the import thread, which will cause a panic asframe
is&mut self
.The quickest workaround is to not implement
ScriptLanguageExtension::frame
.The text was updated successfully, but these errors were encountered: