Improve thread IDs to avoid collisions with threads not created by the Godot API.

This commit is contained in:
bruvzg 2021-03-07 00:17:20 +02:00
parent 05248535f7
commit 9887c2b4f0
No known key found for this signature in database
GPG key ID: 009E1BFE42239B95
2 changed files with 17 additions and 12 deletions

View file

@ -62,9 +62,10 @@ private:
friend class Main;
static ID main_thread_id;
static SafeNumeric<Thread::ID> last_thread_id;
ID id = 0;
static uint64_t _thread_id_hash(const std::thread::id &p_t);
ID id = _thread_id_hash(std::thread::id());
static thread_local ID caller_id;
std::thread thread;