mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Fix thread IDs.
On Linux, thread IDs were not properly assigned with the current approach. The line: `std::thread new_thread(&Thread::callback, _thread_id_hash(thread.get_id()), p_settings, p_callback, p_user);` does not work because the thread ID is not assigned until the thread starts. This PR changes the behavior to use manually generated thread IDs. Additionally, if a thread is (or may have been created) outside Godot, the method `Thread::attach_external_thread` was added.
This commit is contained in:
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
static int test_entrypoint(int argc, char *argv[], bool &tests_need_run);
|
||||
static Error setup(const char *execpath, int argc, char *argv[], bool p_second_phase = true);
|
||||
static Error setup2(Thread::ID p_main_tid_override = 0);
|
||||
static Error setup2(); // The thread calling setup2() will effectively become the main thread.
|
||||
static String get_rendering_driver_name();
|
||||
#ifdef TESTS_ENABLED
|
||||
static Error test_setup();
|
||||
|
||||
Reference in New Issue
Block a user