deleting consumer thread on pool destruction

Tento commit je obsažen v:
Evgeny committed 2018-06-18 12:59:07 -05:00
1 rodič 9086dee75d
revize b71675077a
3 files changed
+30 -22

No files matched your search

+6
Zobrazit soubor
@@ -143,7 +143,13 @@ class MemoryPool {
}
~MemoryPool() {
std::lock_guard<mutex_t> lock(write_mutex_);
Flush();
PTHREAD_CALL(pthread_cancel(consumer_thread_));
void *res;
PTHREAD_CALL(pthread_join(consumer_thread_, &res));
if (res != PTHREAD_CANCELED) EXC_ABORT(ROCTRACER_STATUS_ERROR, "consumer thread wasn't stopped correctly");
allocator_default(&pool_begin_, 0, alloc_arg_);
}