File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3062,6 +3062,7 @@ PCM::PCM() :
3062
3062
#ifdef PCM_USE_PERF
3063
3063
canUsePerf = true ;
3064
3064
perfEventHandle.resize (num_cores, std::vector<int >(PERF_MAX_COUNTERS, -1 ));
3065
+ std::fill (perfTopDownPos.begin (), perfTopDownPos.end (), 0 );
3065
3066
#endif
3066
3067
3067
3068
for (int32 i = 0 ; i < num_cores; ++i)
Original file line number Diff line number Diff line change @@ -351,13 +351,16 @@ void readAccelCounters(SystemCounterState& sycs_)
351
351
}
352
352
353
353
AcceleratorCounterState* AcceleratorCounterState::instance = NULL ;
354
+
355
+ std::mutex instanceCreationMutexForAcceleratorCounterState{};
356
+
354
357
AcceleratorCounterState * AcceleratorCounterState::getInstance ()
355
358
{
356
359
// lock-free read
357
360
// cppcheck-suppress identicalConditionAfterEarlyExit
358
361
if (instance) return instance;
359
362
360
- std::unique_lock<std::mutex> instanceCreationMutex ;
363
+ std::unique_lock<std::mutex> _ (instanceCreationMutexForAcceleratorCounterState) ;
361
364
// cppcheck-suppress identicalConditionAfterEarlyExit
362
365
if (instance) return instance;
363
366
You can’t perform that action at this time.
0 commit comments