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

Method LockManager

src/lock/lock.cpp:169–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168
169LockManager::LockManager(const string& id, const Config* conf)
170 : PID(getpid()),
171 m_bugcheck(false),
172 m_process(NULL),
173 m_processOffset(0),
174 m_cleanupSync(getPool(), blocking_action_thread, THREAD_high),
175 m_sharedMemory(NULL),
176 m_blockage(false),
177 m_dbId(id),
178 m_config(conf),
179 m_acquireSpins(m_config->getLockAcquireSpins()),
180 m_memorySize(m_config->getLockMemSize()),
181 m_hashSlots(m_config->getLockHashSlots()),
182 m_useBlockingThread(m_config->getServerMode() != MODE_SUPER)
183#ifdef USE_SHMEM_EXT
184 , m_extents(getPool())
185#endif
186{
187 if (m_hashSlots < HASH_MIN_SLOTS)
188 m_hashSlots = HASH_MIN_SLOTS;
189 if (m_hashSlots > HASH_MAX_SLOTS)
190 m_hashSlots = HASH_MAX_SLOTS;
191
192 // memory size required to fit all hash slots, history blocks and header blocks
193 const auto minMemory = sizeof(lhb) +
194 FB_ALIGN(sizeof(shb), FB_ALIGNMENT) +
195 sizeof(lhb::lhb_hash[0]) * m_hashSlots +
196 FB_ALIGN(sizeof(his), FB_ALIGNMENT) * HISTORY_BLOCKS * 2;
197
198 if (m_memorySize < minMemory)
199 m_memorySize = minMemory;
200
201 LocalStatus ls;
202 CheckStatusWrapper localStatus(&ls);
203 if (!init_shared_file(&localStatus))
204 {
205 iscLogStatus("LockManager::LockManager()", &localStatus);
206 status_exception::raise(&localStatus);
207 }
208}
209
210
211LockManager::~LockManager()

Callers

nothing calls this directly

Calls 4

FB_ALIGNFunction · 0.85
iscLogStatusFunction · 0.85
raiseFunction · 0.85
getServerModeMethod · 0.80

Tested by

no test coverage detected