aboutsummaryrefslogtreecommitdiff
path: root/include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h')
-rw-r--r--include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h b/include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h
new file mode 100644
index 0000000..720701a
--- /dev/null
+++ b/include/EASTL/internal/atomic/compiler/msvc/compiler_msvc_cpu_pause.h
@@ -0,0 +1,27 @@
+/////////////////////////////////////////////////////////////////////////////////
+// copyright (c) electronic arts inc. all rights reserved.
+/////////////////////////////////////////////////////////////////////////////////
+
+
+#ifndef EASTL_ATOMIC_INTERNAL_COMPILER_MSVC_CPU_PAUSE_H
+#define EASTL_ATOMIC_INTERNAL_COMPILER_MSVC_CPU_PAUSE_H
+
+#if defined(EA_PRAGMA_ONCE_SUPPORTED)
+ #pragma once
+#endif
+
+
+/////////////////////////////////////////////////////////////////////////////////
+//
+// void EASTL_COMPILER_ATOMIC_CPU_PAUSE()
+//
+// NOTE:
+// Rather obscure macro in Windows.h that expands to pause or rep; nop on
+// compatible x86 cpus or the arm yield on compatible arm processors.
+// This is nicer than switching on platform specific intrinsics.
+//
+#define EASTL_COMPILER_ATOMIC_CPU_PAUSE() \
+ YieldProcessor()
+
+
+#endif /* EASTL_ATOMIC_INTERNAL_COMPILER_MSVC_CPU_PAUSE_H */