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
#[derive(GodotClass)]#[class(base=RefCounted)]structTest{base:Base<RefCounted>,}#[godot_api]implIRefCountedforTest{fninit(base:Base<RefCounted>) -> Self{Self{
base,}}}#[godot_api]implTest{#[func]fncall_me_in_a_new_thread(){godot_print!("hello from another thread");}}
In godot I tried to call the rust function like this
extendsNode3Dvarthreadfunc_ready() ->void:
thread=Thread.new()
thread.start(test)
# Thread must be disposed (or "joined"), for portability.func_exit_tree():
thread.wait_to_finish()
functest():
varop=Test.new()
op.call_me_in_a_new_thread()
It will cause an immediate crash. Is it possible to do that?
The text was updated successfully, but these errors were encountered:
we currently havent figured out how to do this safely. see #18.
if you enable the experimental-threads feature then this shouldn't crash anymore. but you are then acknowledging that it's possible to break safety in subtle ways and it's up to you to enaure nothing bad happens.
I define the rust class like this
In godot I tried to call the rust function like this
It will cause an immediate crash. Is it possible to do that?
The text was updated successfully, but these errors were encountered: