aboutsummaryrefslogtreecommitdiff
path: root/operating-system-experiment/Interlocked.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-06-10 11:43:47 +0800
committercrupest <crupest@outlook.com>2021-06-10 11:43:47 +0800
commit44668df2d970e0286f34b7de9f7125ba7abf7189 (patch)
tree23601ad724afde9bc26deb390425eba93daa06f5 /operating-system-experiment/Interlocked.cpp
parentbc59f70946f58a9df301d5c61d2bc0dbafaa74f5 (diff)
parent500ee4751c4861c4217c067f5d0dcae0cbd55d7c (diff)
downloadlife-44668df2d970e0286f34b7de9f7125ba7abf7189.tar.gz
life-44668df2d970e0286f34b7de9f7125ba7abf7189.tar.bz2
life-44668df2d970e0286f34b7de9f7125ba7abf7189.zip
Merge branch 'main' of https://github.com/crupest/life
Diffstat (limited to 'operating-system-experiment/Interlocked.cpp')
-rw-r--r--operating-system-experiment/Interlocked.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/operating-system-experiment/Interlocked.cpp b/operating-system-experiment/Interlocked.cpp
new file mode 100644
index 0000000..4f224e4
--- /dev/null
+++ b/operating-system-experiment/Interlocked.cpp
@@ -0,0 +1,16 @@
+#include "Interlocked.hpp"
+
+#ifdef CRU_WINDOWS
+#include <Windows.h>
+#else
+#endif
+
+namespace cru {
+void InterlockedIncrease(volatile long long *v) {
+#ifdef CRU_WINDOWS
+ InterlockedIncrement64(v);
+#else
+
+#endif
+}
+} // namespace cru