aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-06-10 11:47:14 +0800
committercrupest <crupest@outlook.com>2021-06-10 11:47:14 +0800
commite44189399bb77c150ab7c856e60249d0f6771b2c (patch)
treea381ad0c5a2d276d0d39acd88cf4ca42aaa7ca0b
parent44668df2d970e0286f34b7de9f7125ba7abf7189 (diff)
downloadlife-e44189399bb77c150ab7c856e60249d0f6771b2c.tar.gz
life-e44189399bb77c150ab7c856e60249d0f6771b2c.tar.bz2
life-e44189399bb77c150ab7c856e60249d0f6771b2c.zip
...
-rw-r--r--operating-system-experiment/Interlocked.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/operating-system-experiment/Interlocked.cpp b/operating-system-experiment/Interlocked.cpp
index 4f224e4..1c0f638 100644
--- a/operating-system-experiment/Interlocked.cpp
+++ b/operating-system-experiment/Interlocked.cpp
@@ -6,11 +6,11 @@
#endif
namespace cru {
-void InterlockedIncrease(volatile long long *v) {
+void InterlockedAdd(volatile long long *v, long long a) {
#ifdef CRU_WINDOWS
- InterlockedIncrement64(v);
+ InterlockedAdd64(v, a);
#else
-
+ __sync_fetch_and_add(v, a);
#endif
}
} // namespace cru