diff options
author | crupest <crupest@outlook.com> | 2021-06-10 11:47:14 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-10 11:47:14 +0800 |
commit | e44189399bb77c150ab7c856e60249d0f6771b2c (patch) | |
tree | a381ad0c5a2d276d0d39acd88cf4ca42aaa7ca0b | |
parent | 44668df2d970e0286f34b7de9f7125ba7abf7189 (diff) | |
download | life-e44189399bb77c150ab7c856e60249d0f6771b2c.tar.gz life-e44189399bb77c150ab7c856e60249d0f6771b2c.tar.bz2 life-e44189399bb77c150ab7c856e60249d0f6771b2c.zip |
...
-rw-r--r-- | operating-system-experiment/Interlocked.cpp | 6 |
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
|