Skip to content
Snippets Groups Projects
Commit 26eb1880 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

ProcStats: simplify ProcStats::instance()

parent 8bb23fbf
No related branches found
No related tags found
1 merge request!1410ProcStats : Use mutex lock to make fetch() thread safe.
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment