mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:26:02 +00:00
Fix really really big Mutex/APC bug. Killing GUI Threads from taskmanager should now work flawlessly, and gui apps should work better; the bug had probably tiny important impact in them
svn path=/trunk/; revision=14264
This commit is contained in:
parent
efa9275d99
commit
2700763b70
1 changed files with 18 additions and 0 deletions
|
@ -162,10 +162,28 @@ KeReleaseMutant(IN PKMUTANT Mutant,
|
||||||
/* Check if the signal state is only single */
|
/* Check if the signal state is only single */
|
||||||
if (Mutant->Header.SignalState == 1) {
|
if (Mutant->Header.SignalState == 1) {
|
||||||
|
|
||||||
|
/* Check if it's below 0 now */
|
||||||
if (PreviousState <= 0) {
|
if (PreviousState <= 0) {
|
||||||
|
|
||||||
|
/* Remove the mutant from the list */
|
||||||
DPRINT("Removing Mutant\n");
|
DPRINT("Removing Mutant\n");
|
||||||
RemoveEntryList(&Mutant->MutantListEntry);
|
RemoveEntryList(&Mutant->MutantListEntry);
|
||||||
|
|
||||||
|
/* Reenable APCs */
|
||||||
|
DPRINT("Re-enabling APCs\n");
|
||||||
|
CurrentThread->KernelApcDisable += Mutant->ApcDisable;
|
||||||
|
|
||||||
|
/* Force an Interrupt if Apcs are pending */
|
||||||
|
if (!IsListEmpty(&CurrentThread->ApcState.ApcListHead[KernelMode])) {
|
||||||
|
|
||||||
|
/* Make sure they aren't disabled though */
|
||||||
|
if (!CurrentThread->KernelApcDisable) {
|
||||||
|
|
||||||
|
/* Request the Interrupt */
|
||||||
|
DPRINT("Requesting APC Interupt\n");
|
||||||
|
HalRequestSoftwareInterrupt(APC_LEVEL);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the Owning Thread and wake it */
|
/* Remove the Owning Thread and wake it */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue