mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 12:55:43 +00:00
correct bug in release of semaphore
svn path=/trunk/; revision=357
This commit is contained in:
parent
d7acbe2251
commit
472aba6da2
1 changed files with 11 additions and 7 deletions
|
@ -107,6 +107,8 @@ static BOOLEAN KeDispatcherObjectWakeOne(DISPATCHER_HEADER* hdr)
|
||||||
WaitListEntry);
|
WaitListEntry);
|
||||||
DPRINT("current_entry %x current %x\n",current_entry,current);
|
DPRINT("current_entry %x current %x\n",current_entry,current);
|
||||||
DPRINT("Waking %x\n",current->Thread);
|
DPRINT("Waking %x\n",current->Thread);
|
||||||
|
if (hdr->Type == SemaphoreType)
|
||||||
|
hdr->SignalState--;
|
||||||
PsResumeThread(CONTAINING_RECORD(current->Thread,ETHREAD,Tcb));
|
PsResumeThread(CONTAINING_RECORD(current->Thread,ETHREAD,Tcb));
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -136,12 +138,15 @@ BOOLEAN KeDispatcherObjectWake(DISPATCHER_HEADER* hdr)
|
||||||
return(Ret);
|
return(Ret);
|
||||||
|
|
||||||
case SemaphoreType:
|
case SemaphoreType:
|
||||||
Ret = KeDispatcherObjectWakeOne(hdr);
|
if(hdr->SignalState>0)
|
||||||
if (Ret)
|
|
||||||
{
|
{
|
||||||
hdr->SignalState--;
|
do
|
||||||
}
|
{
|
||||||
|
Ret = KeDispatcherObjectWakeOne(hdr);
|
||||||
|
} while(hdr->SignalState > 0 && Ret) ;
|
||||||
return(Ret);
|
return(Ret);
|
||||||
|
}
|
||||||
|
else return FALSE;
|
||||||
|
|
||||||
case ProcessType:
|
case ProcessType:
|
||||||
return(KeDispatcherObjectWakeAll(hdr));
|
return(KeDispatcherObjectWakeAll(hdr));
|
||||||
|
@ -190,7 +195,6 @@ NTSTATUS KeWaitForSingleObject(PVOID Object,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SemaphoreType:
|
case SemaphoreType:
|
||||||
hdr->SignalState--;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
KeReleaseDispatcherDatabaseLock(FALSE);
|
KeReleaseDispatcherDatabaseLock(FALSE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue