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 *****************************************************************/
18 /* FUNCTIONS *****************************************************************/
20 #undef KeEnterCriticalRegion
21 #undef KeLeaveCriticalRegion
23 ExAcquireFastMutex (PFAST_MUTEX FastMutex
)
25 KeEnterCriticalRegion();
26 ExAcquireFastMutexUnsafe(FastMutex
);
31 ExReleaseFastMutex (PFAST_MUTEX FastMutex
)
33 ExReleaseFastMutexUnsafe(FastMutex
);
34 KeLeaveCriticalRegion();
39 ExTryToAcquireFastMutex (PFAST_MUTEX FastMutex
)
41 KeEnterCriticalRegion();
42 if (InterlockedExchange(&FastMutex
->Count
, 0) == 1)
44 FastMutex
->Owner
= KeGetCurrentThread();
49 KeLeaveCriticalRegion();