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

Function lockSharedSection

src/common/isc_sync.cpp:2164–2178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2162
2163
2164static inline void lockSharedSection(volatile FAST_MUTEX_SHARED_SECTION* lpSect, ULONG SpinCount)
2165{
2166 while (InterlockedExchange(FIX_TYPE(&lpSect->lSpinLock), 1) != 0)
2167 {
2168 ULONG j = SpinCount;
2169 while (j != 0)
2170 {
2171 if (lpSect->lSpinLock == 0)
2172 goto next;
2173 j--;
2174 }
2175 switchToThread();
2176next:;
2177 }
2178}
2179
2180static inline bool tryLockSharedSection(volatile FAST_MUTEX_SHARED_SECTION* lpSect)
2181{

Callers 2

enterFastMutexFunction · 0.85
leaveFastMutexFunction · 0.85

Calls 1

switchToThreadFunction · 0.85

Tested by

no test coverage detected