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

Method initMutexes

src/common/classes/locks.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50pthread_mutexattr_t Mutex::attr;
51
52void Mutex::initMutexes()
53{
54 static std::once_flag onceFlag;
55 std::call_once(onceFlag, [] {
56 // Throw exceptions on errors, but they will not be processed in init
57 // (first constructor). Better logging facilities are required here.
58 int rc = pthread_mutexattr_init(&attr);
59 if (rc < 0)
60 system_call_failed::raise("pthread_mutexattr_init", rc);
61
62 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
63 if (rc < 0)
64 system_call_failed::raise("pthread_mutexattr_settype", rc);
65 });
66}
67
68#endif
69

Callers

nothing calls this directly

Calls 2

raiseFunction · 0.85
call_onceFunction · 0.50

Tested by

no test coverage detected