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

ProcStats: simplify ProcStats::instance()

parent 6118e38b
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !1410. Comments created here will be created in the context of that merge request.
...@@ -241,10 +241,8 @@ struct linux_proc { ...@@ -241,10 +241,8 @@ struct linux_proc {
#endif // __linux__ or __APPLE__ #endif // __linux__ or __APPLE__
ProcStats* ProcStats::instance() { ProcStats* ProcStats::instance() {
static std::once_flag alloc_instance_once; static ProcStats inst{};
static std::unique_ptr<ProcStats> inst; return &inst;
std::call_once( alloc_instance_once, []() { inst = std::make_unique<ProcStats>(); } );
return inst.get();
} }
ProcStats::ProcStats() { 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