summaryrefslogtreecommitdiff
path: root/core/os/thread.cpp
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-03-27 20:14:47 +0200
committerGitHub <noreply@github.com>2023-03-27 20:14:47 +0200
commit19501f8eb19481b029f67ecf78e711d42f2fc431 (patch)
tree933ea3320b35bce6ba65ab1e1d1aa8ad662c90d4 /core/os/thread.cpp
parentcacf49999e3fb37281d66cc591ca8bebc5712d4d (diff)
parent843f5adbc523ad2511322b4f09b5ce5a3fb9e225 (diff)
Merge pull request #75397 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 1st batch
Diffstat (limited to 'core/os/thread.cpp')
-rw-r--r--core/os/thread.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/os/thread.cpp b/core/os/thread.cpp
index 9d16392b2a..92865576f3 100644
--- a/core/os/thread.cpp
+++ b/core/os/thread.cpp
@@ -50,8 +50,8 @@ void Thread::_set_platform_functions(const PlatformFunctions &p_functions) {
platform_functions = p_functions;
}
-void Thread::callback(Thread *p_self, const Settings &p_settings, Callback p_callback, void *p_userdata) {
- Thread::caller_id = _thread_id_hash(p_self->thread.get_id());
+void Thread::callback(ID p_caller_id, const Settings &p_settings, Callback p_callback, void *p_userdata) {
+ Thread::caller_id = p_caller_id;
if (platform_functions.set_priority) {
platform_functions.set_priority(p_settings.priority);
}
@@ -79,7 +79,7 @@ void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_
std::thread empty_thread;
thread.swap(empty_thread);
}
- std::thread new_thread(&Thread::callback, this, p_settings, p_callback, p_user);
+ std::thread new_thread(&Thread::callback, _thread_id_hash(thread.get_id()), p_settings, p_callback, p_user);
thread.swap(new_thread);
id = _thread_id_hash(thread.get_id());
}