summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2021-02-25 13:16:27 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2021-02-25 13:16:27 +0100
commitafc5af8dfa7dd3076c7d6a347d96c81d82be88fe (patch)
tree75ebb515636c772c630deac87ce4271a552e5a14 /core
parent2adacd751c9f83f0dbbedcd2d4ce112104e09513 (diff)
Prevent thread wait on itself for finish
Diffstat (limited to 'core')
-rw-r--r--core/os/thread.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/os/thread.cpp b/core/os/thread.cpp
index 88744eed63..aea370787d 100644
--- a/core/os/thread.cpp
+++ b/core/os/thread.cpp
@@ -92,6 +92,7 @@ bool Thread::is_started() const {
void Thread::wait_to_finish() {
if (id != 0) {
+ ERR_FAIL_COND_MSG(id == get_caller_id(), "A Thread can't wait for itself to finish.");
thread.join();
std::thread empty_thread;
thread.swap(empty_thread);