2005-11-19 22:13:35 +00:00
|
|
|
/*
|
2005-01-26 13:58:37 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
2005-11-19 22:13:35 +00:00
|
|
|
* PROJECT: ReactOS Kernel
|
1998-08-25 04:27:26 +00:00
|
|
|
* FILE: ntoskrnl/ex/fmutex.c
|
|
|
|
* PURPOSE: Implements fast mutexes
|
2005-11-19 22:13:35 +00:00
|
|
|
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
|
1998-08-25 04:27:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
2004-08-15 16:39:12 +00:00
|
|
|
#include <ntoskrnl.h>
|
2007-04-09 13:00:38 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
1998-08-25 04:27:26 +00:00
|
|
|
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Undefine some macros we implement here */
|
|
|
|
#undef ExEnterCriticalRegionAndAcquireFastMutexUnsafe
|
|
|
|
#undef ExReleaseFastMutexUnsafeAndLeaveCriticalRegion
|
|
|
|
#undef ExAcquireFastMutex
|
|
|
|
#undef ExReleaseFastMutex
|
|
|
|
#undef ExAcquireFastMutexUnsafe
|
|
|
|
#undef ExReleaseFastMutexUnsafe
|
|
|
|
#undef ExTryToAcquireFastMutex
|
2007-04-09 13:00:38 +00:00
|
|
|
|
|
|
|
/* PUBLIC FUNCTIONS **********************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
|
|
|
|
{
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Call the inline */
|
2015-04-24 19:40:38 +00:00
|
|
|
_ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FastMutex);
|
2007-04-09 13:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(IN OUT PFAST_MUTEX FastMutex)
|
|
|
|
{
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Call the inline */
|
2015-04-24 19:40:38 +00:00
|
|
|
_ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FastMutex);
|
2005-11-19 22:13:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
2007-04-09 13:00:38 +00:00
|
|
|
ExAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex)
|
2005-11-19 22:13:35 +00:00
|
|
|
{
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Call the inline */
|
|
|
|
_ExAcquireFastMutex(FastMutex);
|
2005-11-19 22:13:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
2007-04-09 13:00:38 +00:00
|
|
|
ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex)
|
2005-11-19 22:13:35 +00:00
|
|
|
{
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Call the inline */
|
|
|
|
_ExReleaseFastMutex(FastMutex);
|
1998-08-25 04:27:26 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 06:27:13 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2005-11-19 22:13:35 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2007-04-09 13:00:38 +00:00
|
|
|
ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
|
2005-11-19 22:13:35 +00:00
|
|
|
{
|
2007-04-09 13:00:38 +00:00
|
|
|
/* Acquire the mutex unsafely */
|
2009-01-30 16:45:17 +00:00
|
|
|
_ExAcquireFastMutexUnsafe(FastMutex);
|
2005-11-19 22:13:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
2007-04-09 13:00:38 +00:00
|
|
|
ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
|
1998-08-25 04:27:26 +00:00
|
|
|
{
|
2007-04-09 13:00:38 +00:00
|
|
|
/* Release the mutex unsafely */
|
2009-01-30 16:45:17 +00:00
|
|
|
_ExReleaseFastMutexUnsafe(FastMutex);
|
2005-11-19 22:13:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
2007-04-09 13:00:38 +00:00
|
|
|
ExTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex)
|
2005-11-19 22:13:35 +00:00
|
|
|
{
|
2009-01-30 16:45:17 +00:00
|
|
|
/* Call the inline */
|
|
|
|
return _ExTryToAcquireFastMutex(FastMutex);
|
1998-08-25 04:27:26 +00:00
|
|
|
}
|
|
|
|
|
2000-05-01 14:15:03 +00:00
|
|
|
/* EOF */
|