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

Method release_shmem

src/lock/lock.cpp:3064–3101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3062
3063
3064void LockManager::release_shmem(SRQ_PTR owner_offset)
3065{
3066/**************************************
3067 *
3068 * r e l e a s e _ s h m e m
3069 *
3070 **************************************
3071 *
3072 * Functional description
3073 * Release the mapped lock file. Advance the event count to wake up
3074 * anyone waiting for it. If there appear to be blocking items
3075 * posted.
3076 *
3077 **************************************/
3078
3079 if (!m_sharedMemory->getHeader())
3080 return;
3081
3082 if (owner_offset && m_sharedMemory->getHeader()->lhb_active_owner != owner_offset)
3083 bug(NULL, "release when not owner");
3084
3085#ifdef VALIDATE_LOCK_TABLE
3086 // Validate the lock table occasionally (every 500 releases)
3087 if ((m_sharedMemory->getHeader()->lhb_acquires % (HISTORY_BLOCKS / 2)) == 0)
3088 validate_lhb(m_sharedMemory->getHeader());
3089#endif
3090
3091 if (!m_sharedMemory->getHeader()->lhb_active_owner)
3092 bug(NULL, "release when not active");
3093
3094 DEBUG_DELAY;
3095
3096 m_sharedMemory->getHeader()->lhb_active_owner = 0;
3097
3098 m_sharedMemory->mutexUnlock();
3099
3100 DEBUG_DELAY;
3101}
3102
3103
3104void LockManager::release_request(lrq* request)

Callers 1

~LockTableGuardMethod · 0.45

Calls 2

mutexUnlockMethod · 0.80
getHeaderMethod · 0.45

Tested by

no test coverage detected