From 6cad76ae6790a05286b8ac9e73a18dea30048f13 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 29 Jul 2019 23:13:06 +0200 Subject: [PATCH] Store thread id in queue producer. --- client/tracy_concurrentqueue.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/tracy_concurrentqueue.h b/client/tracy_concurrentqueue.h index 732302aa..f1f373d7 100644 --- a/client/tracy_concurrentqueue.h +++ b/client/tracy_concurrentqueue.h @@ -32,6 +32,7 @@ #include "../common/TracyAlloc.hpp" #include "../common/TracyForceInline.hpp" +#include "../common/TracySystem.hpp" #if defined(__GNUC__) // Disable -Wconversion warnings (spuriously triggered when Traits::size_t and @@ -252,9 +253,10 @@ namespace details ConcurrentQueueProducerTypelessBase* next; std::atomic inactive; ProducerToken* token; + uint64_t threadId; ConcurrentQueueProducerTypelessBase() - : next(nullptr), inactive(false), token(nullptr) + : next(nullptr), inactive(false), token(nullptr), threadId(0) { } }; @@ -2112,6 +2114,7 @@ ProducerToken::ProducerToken(ConcurrentQueue& queue) { if (producer != nullptr) { producer->token = this; + producer->threadId = detail::GetThreadHandleImpl(); } }