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
4
Compare changes
  • Side-by-side
  • Inline
@@ -241,10 +241,8 @@ struct linux_proc {
#endif // __linux__ or __APPLE__
ProcStats* ProcStats::instance() {
static std::once_flag alloc_instance_once;
static std::unique_ptr<ProcStats> inst;
std::call_once( alloc_instance_once, []() { inst = std::make_unique<ProcStats>(); } );
return inst.get();
static ProcStats inst{};
return &inst;
}
ProcStats::ProcStats() {
Loading