Add assertion

This commit is contained in:
kssenii 2022-09-09 13:36:23 +02:00
parent 3dc19b4fe2
commit 6a885430d7
2 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,8 @@ std::vector<ThreadGroupStatus::ProfileEventsCountersAndMemory> ThreadGroupStatus
ThreadStatus::ThreadStatus() ThreadStatus::ThreadStatus()
: thread_id{getThreadId()} : thread_id{getThreadId()}
{ {
chassert(!current_thread);
last_rusage = std::make_unique<RUsageCounters>(); last_rusage = std::make_unique<RUsageCounters>();
memory_tracker.setDescription("(for thread)"); memory_tracker.setDescription("(for thread)");
@ -145,6 +147,8 @@ ThreadStatus::ThreadStatus()
ThreadStatus::~ThreadStatus() ThreadStatus::~ThreadStatus()
{ {
chassert(current_thread);
memory_tracker.adjustWithUntrackedMemory(untracked_memory); memory_tracker.adjustWithUntrackedMemory(untracked_memory);
if (thread_group) if (thread_group)

View File

@ -323,6 +323,7 @@ struct ContextSharedPart
{ {
try try
{ {
LOG_DEBUG(log, "Desctructing threadpool reader");
threadpool_reader->wait(); threadpool_reader->wait();
threadpool_reader.reset(); threadpool_reader.reset();
} }
@ -336,6 +337,7 @@ struct ContextSharedPart
{ {
try try
{ {
LOG_DEBUG(log, "Desctructing threadpool writer");
threadpool_writer->wait(); threadpool_writer->wait();
threadpool_writer.reset(); threadpool_writer.reset();
} }