Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/TsudaKageyu/minhook.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2015-05-29 12:03:00 +0300
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2015-05-29 12:03:00 +0300
commitfb9bec557b36722ce92e60bb3712fec6395383b7 (patch)
tree641e6ae2431ef8fd44565f7664adf17c8632d442 /src
parentf0e15aea84f6e6eabdce975a19223f5a7cf23e8b (diff)
Remove MemoryBarrierEx().
InterlockedCompareExchange() and InterlockedExchange() generate full memory barrier themselves.
Diffstat (limited to 'src')
-rw-r--r--src/hook.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/hook.c b/src/hook.c
index f9481db..e4465dc 100644
--- a/src/hook.c
+++ b/src/hook.c
@@ -435,18 +435,6 @@ static MH_STATUS EnableAllHooksLL(BOOL enable)
}
//-------------------------------------------------------------------------
-static FORCEINLINE VOID MemoryBarrierEx()
-{
-#if _MSC_VER
- MemoryBarrier();
-#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
- __sync_synchronize();
-#else
- __asm__ __volatile__("" : : : "memory");
-#endif
-}
-
-//-------------------------------------------------------------------------
static VOID EnterSpinLock(VOID)
{
SIZE_T spinCount = 0;
@@ -454,8 +442,6 @@ static VOID EnterSpinLock(VOID)
// Wait until the flag is FALSE.
while (InterlockedCompareExchange(&g_isLocked, TRUE, FALSE) != FALSE)
{
- MemoryBarrierEx();
-
// Prevent the loop from being too busy.
if (spinCount < 32)
Sleep(0);
@@ -469,7 +455,6 @@ static VOID EnterSpinLock(VOID)
//-------------------------------------------------------------------------
static VOID LeaveSpinLock(VOID)
{
- MemoryBarrierEx();
InterlockedExchange(&g_isLocked, FALSE);
}