Skip to content
Snippets Groups Projects

ProcStats : Use mutex lock to make fetch() thread safe.

Merged Christopher Rob Jones requested to merge jonrob/Gaudi:ProcStats-thread-safe into master
All threads resolved!
Compare and Show latest version
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -261,10 +261,10 @@ ProcStats::ProcStats() {
bool ProcStats::fetch( procInfo& f ) {
if ( !m_valid ) { return false; }
#if defined( __linux__ ) or defined( __APPLE__ )
std::scoped_lock lock{ m_mutex };
#if defined( __linux__ ) or defined( __APPLE__ )
double pr_size{ 0 }, pr_rssize{ 0 };
linux_proc pinfo;
int cnt{ 0 };
Loading