dispatch vs profiling packets signals race fixed

Change-Id: I7f250d01f3d45f3f8ec2539b2187ab99503850aa


[ROCm/rocprofiler commit: caa15d7186]
This commit is contained in:
Evgeny
2018-03-16 10:34:44 -05:00
parent a900f3eda4
commit 6e4240aef7
9 ha cambiato i file con 61 aggiunte e 24 eliminazioni
+3 -3
Vedi File
@@ -6,6 +6,7 @@
#include <hsa.h>
#include <hsa_ext_amd.h>
#include <map>
#include <mutex>
#include <vector>
#include "core/metrics.h"
@@ -125,8 +126,7 @@ class Group {
}
void ResetRefs() { refs_ = n_profiles_; }
uint32_t DecrRefs() {
--refs_;
return refs_;
return (refs_ > 0) ? --refs_ : 0;
}
private:
@@ -395,7 +395,7 @@ class Context {
uint32_t r = group->DecrRefs();
group->GetContext()->mutex_.unlock();
if (r == 0) {
group->GetContext()->handler_(group->GetGroup(), group->GetContext()->handler_arg_);
return group->GetContext()->handler_(group->GetGroup(), group->GetContext()->handler_arg_);
}
return false;
}