| 209 | |
| 210 | |
| 211 | LockManager::~LockManager() |
| 212 | { |
| 213 | const SRQ_PTR process_offset = m_processOffset; |
| 214 | |
| 215 | { // guardian's scope |
| 216 | LockTableGuard guard(this, FB_FUNCTION); |
| 217 | m_processOffset = 0; |
| 218 | } |
| 219 | |
| 220 | LocalStatus ls; |
| 221 | CheckStatusWrapper localStatus(&ls); |
| 222 | |
| 223 | if (m_process) |
| 224 | { |
| 225 | if (m_useBlockingThread) |
| 226 | { |
| 227 | // Wait for AST thread to start (or 5 secs) |
| 228 | m_startupSemaphore.tryEnter(5); |
| 229 | |
| 230 | // Wakeup the AST thread - it might be blocking |
| 231 | (void) // Ignore errors in dtor() |
| 232 | m_sharedMemory->eventPost(&m_process->prc_blocking); |
| 233 | |
| 234 | // Wait for the AST thread to finish cleanup or for 5 seconds |
| 235 | m_cleanupSync.waitForCompletion(); |
| 236 | } |
| 237 | |
| 238 | #ifdef HAVE_OBJECT_MAP |
| 239 | m_sharedMemory->unmapObject(&localStatus, &m_process); |
| 240 | #else |
| 241 | m_process = NULL; |
| 242 | #endif |
| 243 | } |
| 244 | |
| 245 | { // guardian's scope |
| 246 | LockTableGuard guard(this, FB_FUNCTION, DUMMY_OWNER); |
| 247 | |
| 248 | if (process_offset) |
| 249 | { |
| 250 | prc* const process = (prc*) SRQ_ABS_PTR(process_offset); |
| 251 | purge_process(process); |
| 252 | } |
| 253 | |
| 254 | if (m_sharedMemory->getHeader() && SRQ_EMPTY(m_sharedMemory->getHeader()->lhb_processes)) |
| 255 | { |
| 256 | PathName name; |
| 257 | get_shared_file_name(name); |
| 258 | m_sharedMemory->removeMapFile(); |
| 259 | #ifdef USE_SHMEM_EXT |
| 260 | for (ULONG i = 1; i < m_extents.getCount(); ++i) |
| 261 | { |
| 262 | m_extents[i].removeMapFile(); |
| 263 | } |
| 264 | #endif //USE_SHMEM_EXT |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | #ifdef USE_SHMEM_EXT |
nothing calls this directly
no test coverage detected