1 /* $Id: fmutex.c,v 1.1 2000/06/09 20:05:00 ekohl Exp $
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)
13 /* INCLUDES *****************************************************************/
15 #include <ddk/ntddk.h>
17 #include <internal/debug.h>
19 /* FUNCTIONS *****************************************************************/
28 KeEnterCriticalRegion();
29 if (InterlockedDecrement(&(FastMutex
->Count
))==0)
33 FastMutex
->Contention
++;
34 KeWaitForSingleObject(&(FastMutex
->Event
),
39 FastMutex
->Owner
=KeGetCurrentThread();
50 assert(FastMutex
->Owner
== KeGetCurrentThread());
51 FastMutex
->Owner
=NULL
;
52 if (InterlockedIncrement(&(FastMutex
->Count
))<=0)
56 KeSetEvent(&(FastMutex
->Event
),0,FALSE
);
58 KeLeaveCriticalRegion();
65 ExTryToAcquireFastMutex (