2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/ke/sem.c
5 * PURPOSE: Implements kernel semaphores
6 * PROGRAMMER: David Welch (welch@mcmail.com)
11 /* INCLUDES *****************************************************************/
13 #include <ddk/ntddk.h>
14 #include <internal/ke.h>
16 #include <internal/debug.h>
18 /* FUNCTIONS *****************************************************************/
20 VOID
KeInitializeSemaphore(PKSEMAPHORE Semaphore
,
24 KeInitializeDispatcherHeader(&Semaphore
->Header
,SemaphoreType
,
25 sizeof(KSEMAPHORE
)/sizeof(ULONG
),
27 Semaphore
->Limit
=Limit
;
30 LONG
KeReadStateSemaphore(PKSEMAPHORE Semaphore
)
32 return(Semaphore
->Header
.SignalState
);
35 LONG
KeReleaseSemaphore(PKSEMAPHORE Semaphore
,