summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/wrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'video-ps3eye/wrapper.cxx')
-rw-r--r--video-ps3eye/wrapper.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/video-ps3eye/wrapper.cxx b/video-ps3eye/wrapper.cxx
index 4a2c2000..291f3e8f 100644
--- a/video-ps3eye/wrapper.cxx
+++ b/video-ps3eye/wrapper.cxx
@@ -4,6 +4,7 @@
#include "ps3eye-driver/ps3eye.hpp"
#include <cstdlib>
+#include <atomic>
#ifdef __clang__
# pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
@@ -15,13 +16,6 @@
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
-#ifdef _MSC_VER
-# include <windows.h>
-# define FULL_BARRIER [](){ _ReadWriteBarrier(); MemoryBarrier(); }
-#else
-# define FULL_BARRIER __sync_synchronize
-#endif
-
template<int N, typename... xs>
[[noreturn]]
static void error(volatile ps3eye::shm_out& out, const char (&error)[N], const xs&... args)
@@ -88,7 +82,7 @@ int main(int argc, char** argv)
out.timecode = 0;
in.do_exit = false;
- FULL_BARRIER();
+ std::atomic_thread_fence(std::memory_order_seq_cst);
for (;;)
{
@@ -117,7 +111,7 @@ int main(int argc, char** argv)
if (in.do_exit)
break;
- FULL_BARRIER();
+ std::atomic_thread_fence(std::memory_order_seq_cst);
}
return 0;