| 308 | |
| 309 | |
| 310 | bool LockManager::init_shared_file(CheckStatusWrapper* statusVector) |
| 311 | { |
| 312 | PathName name; |
| 313 | get_shared_file_name(name); |
| 314 | |
| 315 | try |
| 316 | { |
| 317 | SharedMemory<lhb>* tmp = FB_NEW_POOL(getPool()) SharedMemory<lhb>(name.c_str(), m_memorySize, this); |
| 318 | // initialize will reset m_sharedMemory |
| 319 | fb_assert(m_sharedMemory == tmp); |
| 320 | |
| 321 | const auto header = tmp->getHeader(); |
| 322 | checkHeader(header); |
| 323 | |
| 324 | // Get properly aligned value |
| 325 | m_memorySize = m_sharedMemory->sh_mem_increment; |
| 326 | } |
| 327 | catch (const Exception& ex) |
| 328 | { |
| 329 | ex.stuffException(statusVector); |
| 330 | return false; |
| 331 | } |
| 332 | |
| 333 | #ifdef USE_SHMEM_EXT |
| 334 | m_extents[0] = *this; |
| 335 | #endif |
| 336 | |
| 337 | return true; |
| 338 | } |
| 339 | |
| 340 | |
| 341 | void LockManager::get_shared_file_name(PathName& name, ULONG extent) const |
nothing calls this directly
no test coverage detected