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

Method ConfigStorage

src/jrd/trace/TraceConfigStorage.cpp:87–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87ConfigStorage::ConfigStorage()
88 : m_timer(FB_NEW TouchFile),
89 m_sharedMemory(NULL),
90 m_filename(getPool()),
91 m_recursive(0),
92 m_mutexTID(0),
93 m_dirty(false)
94{
95#ifdef WIN_NT
96 DWORD sesID = 0;
97
98 typedef BOOL (WINAPI *PFnProcessIdToSessionId) (DWORD, DWORD *);
99
100 HMODULE hmodKernel32 = GetModuleHandle("kernel32.dll");
101
102 PFnProcessIdToSessionId pfnProcessIdToSessionId =
103 (PFnProcessIdToSessionId) GetProcAddress(hmodKernel32, "ProcessIdToSessionId");
104
105 if (fb_utils::privateNameSpaceReady() ||
106 fb_utils::isGlobalKernelPrefix() ||
107 !pfnProcessIdToSessionId ||
108 pfnProcessIdToSessionId(GetCurrentProcessId(), &sesID) == 0 ||
109 sesID == 0)
110 {
111 m_filename.printf(TRACE_FILE); // TODO: it must be per engine instance
112 }
113 else
114 {
115 m_filename.printf("%s.%u", TRACE_FILE, sesID);
116 }
117#else
118 m_filename.printf(TRACE_FILE); // TODO: it must be per engine instance
119#endif
120
121 initSharedFile();
122
123 StorageGuard guard(this);
124 checkAudit();
125
126 TEXT fullName[MAXPATHLEN];
127 iscPrefixLock(fullName, m_filename.c_str(), false);
128 m_timer->start(fullName); // do we still need a timer ?
129
130 ++(m_sharedMemory->getHeader()->cnt_uses);
131}
132
133ConfigStorage::~ConfigStorage()
134{

Callers

nothing calls this directly

Calls 7

privateNameSpaceReadyFunction · 0.85
isGlobalKernelPrefixFunction · 0.85
iscPrefixLockFunction · 0.85
printfMethod · 0.45
c_strMethod · 0.45
startMethod · 0.45
getHeaderMethod · 0.45

Tested by

no test coverage detected