The threading API has changed between Godot 3 and Godot 4. See https://github.com/godotengine/godot-proposals/issues/4691.