ExReleaseRundownProtectionCacheAwareEx

void __stdcall ExReleaseRundownProtectionCacheAwareEx(PEX_RUNDOWN_REF_CACHE_AWARE RunRef, ULONG Count){
  _EX_RUNDOWN_REF *RunRefs; 
  signed __int64 v3; 
  unsigned __int64 v4; 
  RunRefs = (_EX_RUNDOWN_REF *)((char *)RunRef->RunRefs
                              + RunRef->RunRefSize * (*((_DWORD *)KeGetPcr() + 105) % RunRef->Number));
  _m_prefetchw(RunRefs);
  while( 1 )
  {
    while( 1 )
    {
      v3 = RunRefs->Count;
      if( (RunRefs->Count & 1) != 0 )
        break;
      if( v3 == _InterlockedCompareExchange64((volatile signed __int64 *)RunRefs, v3 - 2 * Count, v3) )
        return;
    }
    if( v3 != 1 )
      break;
    RunRefs = RunRef->RunRefs;
  }
  v4 = v3 & 0xFFFFFFFFFFFFFFFEui64;
  if( _InterlockedExchangeAdd64((volatile signed __int64 *)v4, -Count) == Count )
    KeSetEvent((PRKEVENT)(v4 + 8), 0);
}

Referenced by:

EtwInitialize
EtwpAcquireLoggerContextByLoggerId
EtwpCancelPendingStackwalkApcs
EtwpCloseLogger
EtwpCompressionProc
EtwpEventWriteFull
EtwpFailLogging
EtwpFinalizePendingApc
EtwpFreeLoggerContext
EtwpLogKernelEvent
EtwpQueueStackWalkApc
EtwpQueueStackWalkDpc
EtwpReleaseLoggerContext
EtwpStackWalkDpc
EtwpStartLogger
EtwpStopTrace
EtwpTraceMessageVa
EtwpWriteUserEvent
RawEndOperation