mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
work on semaphores.
svn path=/trunk/; revision=341
This commit is contained in:
parent
42c50bfaa8
commit
e4981e3a09
1 changed files with 10 additions and 4 deletions
|
@ -101,6 +101,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -148,15 +150,19 @@ NTSTATUS KeWaitForSingleObject(PVOID Object,
|
||||||
KWAIT_BLOCK blk;
|
KWAIT_BLOCK blk;
|
||||||
|
|
||||||
DPRINT("Entering KeWaitForSingleObject(Object %x)\n",Object);
|
DPRINT("Entering KeWaitForSingleObject(Object %x)\n",Object);
|
||||||
|
// FIXME : if KeReleaseSemaphore called with wait just before KeWaitxxx
|
||||||
|
// we must do something special.
|
||||||
|
|
||||||
KeAcquireDispatcherDatabaseLock(FALSE);
|
KeAcquireDispatcherDatabaseLock(FALSE);
|
||||||
|
|
||||||
if (hdr->SignalState)
|
if (hdr->SignalState > 0)
|
||||||
{
|
{
|
||||||
if (hdr->Type == SynchronizationEvent)
|
if (hdr->Type == SynchronizationEvent)
|
||||||
{
|
{
|
||||||
hdr->SignalState=FALSE;
|
hdr->SignalState=FALSE;
|
||||||
}
|
}
|
||||||
|
else if (hdr->Type == SemaphoreType)
|
||||||
|
hdr->SignalState--;
|
||||||
KeReleaseDispatcherDatabaseLock(FALSE);
|
KeReleaseDispatcherDatabaseLock(FALSE);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue