mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 18:54:25 +00:00
[NTOSKRNL]
- Fix wait asserts to account for the Thread->WaitNext case - At least output a warning in place of the assertion failure in KeWaitForMultipleObjects See issue #7129 for more details. svn path=/trunk/; revision=56749
This commit is contained in:
parent
07a7af33f2
commit
9d043b385a
|
@ -417,9 +417,12 @@ KeWaitForSingleObject(IN PVOID Object,
|
|||
PLARGE_INTEGER OriginalDueTime = Timeout;
|
||||
ULONG Hand = 0;
|
||||
|
||||
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL ||
|
||||
(KeGetCurrentIrql() == DISPATCH_LEVEL &&
|
||||
Timeout && Timeout->QuadPart == 0));
|
||||
if (Thread->WaitNext)
|
||||
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
|
||||
else
|
||||
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL ||
|
||||
(KeGetCurrentIrql() == DISPATCH_LEVEL &&
|
||||
Timeout && Timeout->QuadPart == 0));
|
||||
|
||||
/* Check if the lock is already held */
|
||||
if (!Thread->WaitNext) goto WaitStart;
|
||||
|
@ -587,10 +590,17 @@ KeWaitForMultipleObjects(IN ULONG Count,
|
|||
LARGE_INTEGER DueTime = {{0}}, NewDueTime, InterruptTime;
|
||||
ULONG Index, Hand = 0;
|
||||
|
||||
/* HACK: tcpip is broken and waits with spinlocks acquired (bug #7129) */
|
||||
/*ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL ||
|
||||
(KeGetCurrentIrql() == DISPATCH_LEVEL &&
|
||||
Timeout && Timeout->QuadPart == 0));*/
|
||||
if (Thread->WaitNext)
|
||||
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
|
||||
else if (KeGetCurrentIrql() == DISPATCH_LEVEL &&
|
||||
(!Timeout || Timeout->QuadPart != 0))
|
||||
{
|
||||
/* HACK: tcpip is broken and waits with spinlocks acquired (bug #7129) */
|
||||
DPRINT1("%s called at DISPATCH_LEVEL with non-zero timeout!\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
else
|
||||
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
|
||||
|
||||
/* Make sure the Wait Count is valid */
|
||||
if (!WaitBlockArray)
|
||||
|
|
Loading…
Reference in a new issue