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 | 1ce9ffb961fa2d2f878131bfc6fe38ce9317a401 (patch) | |
tree | de1deaba15f88c867ea0d017ef49a1e2a92e8392 /works/life | |
parent | fcf8662eba1813e372706f02d6f30e66d04a121d (diff) | |
download | crupest-1ce9ffb961fa2d2f878131bfc6fe38ce9317a401.tar.gz crupest-1ce9ffb961fa2d2f878131bfc6fe38ce9317a401.tar.bz2 crupest-1ce9ffb961fa2d2f878131bfc6fe38ce9317a401.zip |
import(life): ...
Diffstat (limited to 'works/life')
-rw-r--r-- | works/life/operating-system-experiment/Interlocked.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/works/life/operating-system-experiment/Interlocked.cpp b/works/life/operating-system-experiment/Interlocked.cpp index 4f224e4..1c0f638 100644 --- a/works/life/operating-system-experiment/Interlocked.cpp +++ b/works/life/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
|