Move caller_id init to Thread constructor to fix UWP build.
(cherry picked from commit 741e1cf672
)
This commit is contained in:
parent
f695e7b4d9
commit
8feb53e509
2 changed files with 6 additions and 1 deletions
|
@ -47,7 +47,7 @@ uint64_t Thread::_thread_id_hash(const std::thread::id &p_t) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread::ID Thread::main_thread_id = _thread_id_hash(std::this_thread::get_id());
|
Thread::ID Thread::main_thread_id = _thread_id_hash(std::this_thread::get_id());
|
||||||
thread_local Thread::ID Thread::caller_id = _thread_id_hash(std::this_thread::get_id());
|
thread_local Thread::ID Thread::caller_id = 0;
|
||||||
|
|
||||||
void Thread::_set_platform_funcs(
|
void Thread::_set_platform_funcs(
|
||||||
Error (*p_set_name_func)(const String &),
|
Error (*p_set_name_func)(const String &),
|
||||||
|
@ -112,6 +112,10 @@ Error Thread::set_name(const String &p_name) {
|
||||||
return ERR_UNAVAILABLE;
|
return ERR_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread::Thread() {
|
||||||
|
caller_id = _thread_id_hash(std::this_thread::get_id());
|
||||||
|
}
|
||||||
|
|
||||||
Thread::~Thread() {
|
Thread::~Thread() {
|
||||||
if (id != _thread_id_hash(std::thread::id())) {
|
if (id != _thread_id_hash(std::thread::id())) {
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
|
|
|
@ -98,6 +98,7 @@ public:
|
||||||
///< waits until thread is finished, and deallocates it.
|
///< waits until thread is finished, and deallocates it.
|
||||||
void wait_to_finish();
|
void wait_to_finish();
|
||||||
|
|
||||||
|
Thread();
|
||||||
~Thread();
|
~Thread();
|
||||||
#else
|
#else
|
||||||
_FORCE_INLINE_ ID get_id() const { return 0; }
|
_FORCE_INLINE_ ID get_id() const { return 0; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue