Return type KIRQL fixed to allow compilation.
[reactos.git] / reactos / ntoskrnl / hal / x86 / fmutex.c
1 /* $Id: fmutex.c,v 1.1 2000/06/09 20:05:00 ekohl Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/fmutex.c
6 * PURPOSE: Implements fast mutexes
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * Eric Kohl (ekohl@rz-online.de)
9 * UPDATE HISTORY:
10 * Created 09/06/2000
11 */
12
13 /* INCLUDES *****************************************************************/
14
15 #include <ddk/ntddk.h>
16
17 #include <internal/debug.h>
18
19 /* FUNCTIONS *****************************************************************/
20
21 VOID
22 FASTCALL
23 EXPORTED
24 ExAcquireFastMutex (
25 PFAST_MUTEX FastMutex
26 )
27 {
28 KeEnterCriticalRegion();
29 if (InterlockedDecrement(&(FastMutex->Count))==0)
30 {
31 return;
32 }
33 FastMutex->Contention++;
34 KeWaitForSingleObject(&(FastMutex->Event),
35 Executive,
36 KernelMode,
37 FALSE,
38 NULL);
39 FastMutex->Owner=KeGetCurrentThread();
40 }
41
42
43 VOID
44 FASTCALL
45 EXPORTED
46 ExReleaseFastMutex (
47 PFAST_MUTEX FastMutex
48 )
49 {
50 assert(FastMutex->Owner == KeGetCurrentThread());
51 FastMutex->Owner=NULL;
52 if (InterlockedIncrement(&(FastMutex->Count))<=0)
53 {
54 return;
55 }
56 KeSetEvent(&(FastMutex->Event),0,FALSE);
57
58 KeLeaveCriticalRegion();
59 }
60
61
62 BOOLEAN
63 FASTCALL
64 EXPORTED
65 ExTryToAcquireFastMutex (
66 PFAST_MUTEX FastMutex
67 )
68 {
69 UNIMPLEMENTED;
70 }
71
72 /* EOF */