ccfdcfd904be40fe15b86a49abc6b0a89bb68046
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 *****************************************************************/
19 /* FUNCTIONS *****************************************************************/
21 #undef KeEnterCriticalRegion
22 #undef KeLeaveCriticalRegion
24 ExAcquireFastMutex (PFAST_MUTEX FastMutex
)
26 KeEnterCriticalRegion();
27 ExAcquireFastMutexUnsafe(FastMutex
);
32 ExReleaseFastMutex (PFAST_MUTEX FastMutex
)
34 ExReleaseFastMutexUnsafe(FastMutex
);
35 KeLeaveCriticalRegion();
40 ExTryToAcquireFastMutex (PFAST_MUTEX FastMutex
)
42 KeEnterCriticalRegion();
43 if (InterlockedExchange(&FastMutex
->Count
, 0) == 1)
45 FastMutex
->Owner
= KeGetCurrentThread();
50 KeLeaveCriticalRegion();