Robustify multi-threading primitives

This commit is contained in:
Pedro J. Estébanez
2023-01-28 13:34:06 +01:00
parent 7d135cb962
commit 32a9227f5b
6 changed files with 94 additions and 8 deletions

View File

@@ -121,7 +121,9 @@ Error Thread::set_name(const String &p_name) {
Thread::~Thread() {
if (id != _thread_id_hash(std::thread::id())) {
#ifdef DEBUG_ENABLED
WARN_PRINT("A Thread object has been destroyed without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread.");
WARN_PRINT(
"A Thread object is being destroyed without its completion having been realized.\n"
"Please call wait_to_finish() on it to ensure correct cleanup.");
#endif
thread.detach();
}