summaryrefslogtreecommitdiff
path: root/core/os/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/thread.cpp')
-rw-r--r--core/os/thread.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/core/os/thread.cpp b/core/os/thread.cpp
index 294b52f00c..0ed8825452 100644
--- a/core/os/thread.cpp
+++ b/core/os/thread.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,37 +38,29 @@ Error (*Thread::set_name_func)(const String &) = nullptr;
Thread::ID Thread::_main_thread_id = 0;
Thread::ID Thread::get_caller_id() {
-
- if (get_thread_id_func)
+ if (get_thread_id_func) {
return get_thread_id_func();
+ }
return 0;
}
Thread *Thread::create(ThreadCreateCallback p_callback, void *p_user, const Settings &p_settings) {
-
if (create_func) {
-
return create_func(p_callback, p_user, p_settings);
}
return nullptr;
}
void Thread::wait_to_finish(Thread *p_thread) {
-
- if (wait_to_finish_func)
+ if (wait_to_finish_func) {
wait_to_finish_func(p_thread);
+ }
}
Error Thread::set_name(const String &p_name) {
-
- if (set_name_func)
+ if (set_name_func) {
return set_name_func(p_name);
+ }
return ERR_UNAVAILABLE;
-};
-
-Thread::Thread() {
-}
-
-Thread::~Thread() {
}