Make thread_ids unique

This commit is contained in:
Alexey Milovidov 2022-10-08 02:05:36 +02:00
parent 53b655bfa9
commit ec5a32f534
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ public:
InternalProfileEventsQueueWeakPtr profile_queue_ptr;
std::function<void()> fatal_error_callback;
std::vector<UInt64> thread_ids;
std::unordered_set<UInt64> thread_ids;
std::unordered_set<ThreadStatusPtr> threads;
/// The first thread created this thread group

View File

@ -109,7 +109,7 @@ void ThreadStatus::setupState(const ThreadGroupStatusPtr & thread_group_)
std::lock_guard lock(thread_group->mutex);
/// NOTE: thread may be attached multiple times if it is reused from a thread pool.
thread_group->thread_ids.emplace_back(thread_id);
thread_group->thread_ids.insert(thread_id);
thread_group->threads.insert(this);
logs_queue_ptr = thread_group->logs_queue_ptr;