MCPcopy Create free account
hub / github.com/Vhonowslend/StreamFX-Public / instance

Method instance

source/configuration.cpp:95–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95std::shared_ptr<streamfx::configuration> streamfx::configuration::instance()
96{
97 static std::weak_ptr<streamfx::configuration> winst;
98 static std::mutex mtx;
99
100 std::unique_lock<decltype(mtx)> lock(mtx);
101 auto instance = winst.lock();
102 if (!instance) {
103 instance = std::shared_ptr<streamfx::configuration>(new streamfx::configuration());
104 winst = instance;
105 }
106 return instance;
107}
108
109static std::shared_ptr<streamfx::configuration> loader_instance;
110

Callers

nothing calls this directly

Calls 1

lockMethod · 0.80

Tested by

no test coverage detected