deleting consumer thread on pool destruction

此提交包含在:
Evgeny
2018-06-18 12:58:08 -05:00
父節點 9086dee75d
當前提交 b71675077a
共有 3 個檔案被更改,包括 30 行新增 和 22 行删除
+6
查看文件
@@ -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_);
}