//
// Set the event to release any waiting workers
+ // (everyone waits on IrpPoolHasReleaseEntries)
//
- KeSetEvent( &pCommSrvc->IrpPoolHasEntries,
- 0,
- FALSE);
-
KeSetEvent( &pCommSrvc->IrpPoolHasReleaseEntries,
0,
FALSE);
AFSReleaseResource( &pCommSrvc->IrpPoolLock);
+ //
+ // Wake up the next worker since this is a SynchronizationEvent
+ //
+
+ KeSetEvent( &pCommSrvc->IrpPoolHasReleaseEntries,
+ 0,
+ FALSE);
+
try_return( ntStatus = STATUS_DEVICE_NOT_READY);
}
pEntry = pEntry->fLink;
}
- if( pCommSrvc->RequestPoolHead == NULL)
+ if( pEntry != NULL)
{
- KeClearEvent( &pCommSrvc->IrpPoolHasEntries);
- }
-
- if( pEntry == NULL)
- {
+ //
+ // There might be another release entry pending
+ //
- KeClearEvent( &pCommSrvc->IrpPoolHasReleaseEntries);
+ KeSetEvent( &pCommSrvc->IrpPoolHasReleaseEntries,
+ 0,
+ FALSE);
}
//
pCommSrvc->RequestPoolTail = NULL;
}
- }
- else
- {
+ else
+ {
- KeClearEvent( &pCommSrvc->IrpPoolHasEntries);
+ KeSetEvent( &pCommSrvc->IrpPoolHasEntries,
+ 0,
+ FALSE);
+ }
}
//