Store thread id in queue producer.

This commit is contained in:
Bartosz Taudul 2019-07-29 23:13:06 +02:00
parent 7ae9a28e32
commit 6cad76ae67

View File

@ -32,6 +32,7 @@
#include "../common/TracyAlloc.hpp" #include "../common/TracyAlloc.hpp"
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
#include "../common/TracySystem.hpp"
#if defined(__GNUC__) #if defined(__GNUC__)
// Disable -Wconversion warnings (spuriously triggered when Traits::size_t and // Disable -Wconversion warnings (spuriously triggered when Traits::size_t and
@ -252,9 +253,10 @@ namespace details
ConcurrentQueueProducerTypelessBase* next; ConcurrentQueueProducerTypelessBase* next;
std::atomic<bool> inactive; std::atomic<bool> inactive;
ProducerToken* token; ProducerToken* token;
uint64_t threadId;
ConcurrentQueueProducerTypelessBase() ConcurrentQueueProducerTypelessBase()
: next(nullptr), inactive(false), token(nullptr) : next(nullptr), inactive(false), token(nullptr), threadId(0)
{ {
} }
}; };
@ -2112,6 +2114,7 @@ ProducerToken::ProducerToken(ConcurrentQueue<T, Traits>& queue)
{ {
if (producer != nullptr) { if (producer != nullptr) {
producer->token = this; producer->token = this;
producer->threadId = detail::GetThreadHandleImpl();
} }
} }