buffer wrap-thread startup fix

Change-Id: I857cff63d28dcc068eddbd3ae2bc0193c428ec41
This commit is contained in:
Evgeny
2020-05-07 06:45:29 -05:00
parent 0248ebdb13
commit 3d4f6b3002
3 changed files with 34 additions and 8 deletions
-2
View File
@@ -1198,8 +1198,6 @@ PUBLIC_API roctracer_status_t roctracer_set_properties(
API_METHOD_PREFIX
switch (domain) {
case ACTIVITY_DOMAIN_HSA_OPS: {
roctracer::trace_buffer.StartWorkerThread();
// HSA OPS properties
roctracer::hsa_ops_properties_t* ops_properties = reinterpret_cast<roctracer::hsa_ops_properties_t*>(properties);
HsaApiTable* table = reinterpret_cast<HsaApiTable*>(ops_properties->table);
+1 -1
View File
@@ -231,7 +231,7 @@ class TraceBuffer : protected TraceBufferBase {
void wrap_buffer(const pointer_t pointer) {
std::lock_guard<mutex_t> lck(mutex_);
if (work_thread_started_ == false) FATAL("worker thread is not started");
if (work_thread_started_ == false) StartWorkerThread();
PTHREAD_CALL(pthread_mutex_lock(&work_mutex_));
if (pointer >= end_pointer_) {