Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 259 of file rundown.c.
Referenced by ExCompareExchangeCallBack(), and ExReferenceCallBackBlock().
{ ULONG_PTR Value = RunRef->Count, NewValue; PEX_RUNDOWN_WAIT_BLOCK WaitBlock; /* Loop until successfully incremented the counter */ for (;;) { /* Check if rundown is not active */ if (!(Value & EX_RUNDOWN_ACTIVE)) { /* Sanity check */ ASSERT((Value >= EX_RUNDOWN_COUNT_INC * Count) || (KeNumberProcessors > 1)); /* Get the new value */ NewValue = Value - EX_RUNDOWN_COUNT_INC * Count; /* Change the value */ NewValue = ExpChangeRundown(RunRef, NewValue, Value); if (NewValue == Value) break; /* Update value */ Value = NewValue; } else { /* Get the wait block */ WaitBlock = (PEX_RUNDOWN_WAIT_BLOCK)(Value & ~EX_RUNDOWN_ACTIVE); ASSERT((WaitBlock->Count >= Count) || (KeNumberProcessors > 1)); /* Remove the counts */ if (InterlockedExchangeAddSizeT(&WaitBlock->Count, -(LONG)Count) == (LONG)Count) { /* We're down to 0 now, so signal the event */ KeSetEvent(&WaitBlock->WakeEvent, IO_NO_INCREMENT, FALSE); } /* We're all done */ break; } } }