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 *****************************************************************/
22 ExAcquireFastMutex (PFAST_MUTEX FastMutex
)
24 KeEnterCriticalRegion();
25 ExAcquireFastMutexUnsafe(FastMutex
);
30 ExReleaseFastMutex (PFAST_MUTEX FastMutex
)
32 ExReleaseFastMutexUnsafe(FastMutex
);
33 KeLeaveCriticalRegion();
38 ExTryToAcquireFastMutex (PFAST_MUTEX FastMutex
)
40 KeEnterCriticalRegion();
41 if (InterlockedExchange(&FastMutex
->Count
, 0) == 1)
43 FastMutex
->Owner
= KeGetCurrentThread();
48 KeLeaveCriticalRegion();