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
@@ -288,8 +288,8 @@ bool ProcStats::fetch( procInfo& f ) {
&pinfo.kstkesp, &pinfo.kstkeip, &pinfo.signal, &pinfo.blocked, &pinfo.sigignore, &pinfo.sigcatch,
&pinfo.wchan );
// resident set size in pages
const auto pr_size = (double)pinfo.vsize;
const auto pr_rssize = (double)pinfo.rss;
const auto pr_size = static_cast<double>( pinfo.vsize );
const auto pr_rssize = static_cast<double>( pinfo.rss );
f.vsize = pr_size / ( 1024 * 1024 );
f.rss = pr_rssize * m_pg_size / ( 1024 * 1024 );
}
Loading