0be3e07388
Only check the lock if counter collection is being attempted by the profiler. Not when it is loaded. SWDEV-474455 Change-Id: Ie14de3c8db57e0cbd279ffca51c333a375ca8654 Signed-off-by: Benjamin Welton <bewelton@amd.com>
26 lines
414 B
C++
26 lines
414 B
C++
|
|
#ifndef _SRC_CORE_PROFILING_LOCK_H
|
|
#define _SRC_CORE_PROFILING_LOCK_H
|
|
#include <atomic>
|
|
|
|
enum LockMode{
|
|
PROFILER_V1_LOCK,
|
|
PROFILER_V2_LOCK,
|
|
};
|
|
|
|
class ProfilingLock {
|
|
public:
|
|
static void Lock(LockMode mode);
|
|
~ProfilingLock();
|
|
|
|
private:
|
|
ProfilingLock();
|
|
static ProfilingLock *Instance();
|
|
|
|
const char *lock_file;
|
|
const char *pid_file;
|
|
std::atomic<bool> already_locked{false};
|
|
int lock;
|
|
};
|
|
|
|
#endif |