MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / init

Function init

src/common/classes/init.h:172–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171template <typename C>
172class InitMutex
173{
174private:
175 std::atomic<bool> flag;
176#ifdef DEV_BUILD
177 const char* from;
178#endif
179public:
180 explicit InitMutex(const char* f)
181 : flag(false)
182#ifdef DEV_BUILD
183 , from(f)
184#define FB_LOCKED_FROM from
185#else
186#define FB_LOCKED_FROM NULL
187#endif
188 { }
189 void init()
190 {
191 if (!flag)
192 {
193 MutexLockGuard guard(*StaticMutex::mutex, FB_LOCKED_FROM);
194 if (!flag)
195 {
196 C::init();
197 flag = true;
198 }
199 }
200 }
201 void cleanup()
202 {
203 if (flag)

Callers 15

RWLockMethod · 0.70
MemBaseHunkMethod · 0.70
SemaphoreMethod · 0.70
SignalSafeSemaphoreMethod · 0.70
ConditionMethod · 0.70
MetaStringMethod · 0.70
MetaString.cppFile · 0.70
getBufferMethod · 0.70
printfMethod · 0.70
SpinlockMethod · 0.70
MutexMethod · 0.70
TempFileMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected