deleting consumer thread on pool destruction

Este cometimento está contido em:
Evgeny cometeu 2018-06-18 12:59:07 -05:00
1 ascendente 9086dee75d
cometimento b71675077a
3 ficheiros modificados
+30 -22

Não existem ficheiros que correspondam à sua pesquisa

+6
Ver ficheiro
@@ -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_);
}