uncomment and add mutex asserts

svn path=/trunk/; revision=18024
This commit is contained in:
Gunnar Dalsnes 2005-09-24 11:43:23 +00:00
parent f9725315fe
commit bd79c96a7d

View file

@ -21,7 +21,11 @@
VOID FASTCALL VOID FASTCALL
ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex) ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
{ {
//ASSERT(FastMutex->Owner != KeGetCurrentThread()); ASSERT(KeGetCurrentThread() == NULL || FastMutex->Owner != KeGetCurrentThread());
ASSERT(KeGetCurrentIrql() == APC_LEVEL ||
KeGetCurrentThread() == NULL ||
KeGetCurrentThread()->KernelApcDisable);
InterlockedIncrementUL(&FastMutex->Contention); InterlockedIncrementUL(&FastMutex->Contention);
while (InterlockedExchange(&FastMutex->Count, 0) == 0) while (InterlockedExchange(&FastMutex->Count, 0) == 0)
{ {
@ -41,7 +45,11 @@ ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
VOID FASTCALL VOID FASTCALL
ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex) ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex)
{ {
//ASSERT(FastMutex->Owner == KeGetCurrentThread()); ASSERT(KeGetCurrentThread() == NULL || FastMutex->Owner == KeGetCurrentThread());
ASSERT(KeGetCurrentIrql() == APC_LEVEL ||
KeGetCurrentThread() == NULL ||
KeGetCurrentThread()->KernelApcDisable);
FastMutex->Owner = NULL; FastMutex->Owner = NULL;
InterlockedExchange(&FastMutex->Count, 1); InterlockedExchange(&FastMutex->Count, 1);
if (FastMutex->Contention > 0) if (FastMutex->Contention > 0)