mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
Do not hold the PiThreadListLock spinlock while calling KeDispatchObjectWait() because the latter will acquire the spinlock.
This fixes bug #31. svn path=/trunk/; revision=6505
This commit is contained in:
parent
fc75de898d
commit
08c981ba53
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: kill.c,v 1.66 2003/11/02 01:16:21 ekohl Exp $
|
/* $Id: kill.c,v 1.67 2003/11/02 03:09:06 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -159,11 +159,10 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
||||||
PLIST_ENTRY current_entry;
|
PLIST_ENTRY current_entry;
|
||||||
PKMUTANT Mutant;
|
PKMUTANT Mutant;
|
||||||
|
|
||||||
|
|
||||||
DPRINT("terminating %x\n",CurrentThread);
|
|
||||||
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
||||||
|
|
||||||
CurrentThread = PsGetCurrentThread();
|
CurrentThread = PsGetCurrentThread();
|
||||||
|
DPRINT("terminating %x\n",CurrentThread);
|
||||||
|
|
||||||
CurrentThread->ExitStatus = ExitStatus;
|
CurrentThread->ExitStatus = ExitStatus;
|
||||||
Thread = KeGetCurrentThread();
|
Thread = KeGetCurrentThread();
|
||||||
|
@ -183,12 +182,12 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
||||||
current_entry = Thread->MutantListHead.Flink;
|
current_entry = Thread->MutantListHead.Flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
oldIrql = KeAcquireDispatcherDatabaseLock();
|
||||||
|
|
||||||
KeAcquireDispatcherDatabaseLockAtDpcLevel();
|
|
||||||
CurrentThread->Tcb.DispatcherHeader.SignalState = TRUE;
|
CurrentThread->Tcb.DispatcherHeader.SignalState = TRUE;
|
||||||
KeDispatcherObjectWake(&CurrentThread->Tcb.DispatcherHeader);
|
KeDispatcherObjectWake(&CurrentThread->Tcb.DispatcherHeader);
|
||||||
KeReleaseDispatcherDatabaseLockFromDpcLevel ();
|
KeReleaseDispatcherDatabaseLock (oldIrql);
|
||||||
|
|
||||||
|
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
||||||
|
|
||||||
ExpSwapThreadEventPair(CurrentThread, NULL); /* Release the associated eventpair object, if there was one */
|
ExpSwapThreadEventPair(CurrentThread, NULL); /* Release the associated eventpair object, if there was one */
|
||||||
KeRemoveAllWaitsThread (CurrentThread, STATUS_UNSUCCESSFUL, FALSE);
|
KeRemoveAllWaitsThread (CurrentThread, STATUS_UNSUCCESSFUL, FALSE);
|
||||||
|
|
Loading…
Reference in a new issue