Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 207 of file srw.c.
Referenced by RtlAcquireSRWLockExclusive(), RtlAcquireSRWLockShared(), RtlReleaseSRWLockExclusive(), and RtlReleaseSRWLockShared().
{ LONG_PTR PrevValue; PRTLP_SRWLOCK_WAITBLOCK WaitBlock; while (1) { PrevValue = InterlockedOrPointer(&SRWLock->Ptr, RTL_SRWLOCK_CONTENTION_LOCK); if (!(PrevValue & RTL_SRWLOCK_CONTENTION_LOCK)) break; YieldProcessor(); } if (!(PrevValue & RTL_SRWLOCK_CONTENDED) || (PrevValue & ~RTL_SRWLOCK_MASK) == 0) { /* Too bad, looks like the wait block was removed in the meanwhile, unlock again */ RtlpReleaseWaitBlockLock(SRWLock); return NULL; } WaitBlock = (PRTLP_SRWLOCK_WAITBLOCK)(PrevValue & ~RTL_SRWLOCK_MASK); ASSERT_SRW_WAITBLOCK(WaitBlock); return WaitBlock; }