mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 09:20:30 +00:00
begin implement.
svn path=/trunk/; revision=340
This commit is contained in:
parent
8688a2a272
commit
42c50bfaa8
1 changed files with 18 additions and 1 deletions
|
@ -37,6 +37,23 @@ LONG KeReleaseSemaphore(PKSEMAPHORE Semaphore,
|
||||||
LONG Adjustment,
|
LONG Adjustment,
|
||||||
BOOLEAN Wait)
|
BOOLEAN Wait)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
long initState=Semaphore->Header.SignalState;
|
||||||
|
if(Semaphore->Limit < initState+Adjustment
|
||||||
|
|| initState > initState+Adjustment)
|
||||||
|
ExRaiseStatus(STATUS_SEMAPHORE_LIMIT_EXCEEDED);
|
||||||
|
Semaphore->Header.SignalState+=Adjustment;
|
||||||
|
if((initState == 0)
|
||||||
|
&& (Semaphore->Header.WaitListHead.Flink != &Semaphore->Header.WaitListHead))
|
||||||
|
{
|
||||||
|
// wake up SignalState waiters
|
||||||
|
while(Semaphore->Header.SignalState > 0
|
||||||
|
&& KeDispatcherObjectWakeOne(Semaphore->Header) ) ;
|
||||||
|
}
|
||||||
|
if (Wait)
|
||||||
|
{
|
||||||
|
// FIXME(2) : in this case, we must store somewhere that we have been here
|
||||||
|
// and the functions KeWaitxxx must take care of this
|
||||||
|
}
|
||||||
|
return initState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue