Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: webrtc/base/atomicops.h

Issue 1537923003: Fix pointer compare-and-swap on Windows. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix argument order Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/base/criticalsection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/atomicops.h
diff --git a/webrtc/base/atomicops.h b/webrtc/base/atomicops.h
index 188cd3f18964543f31b369273e1899d08d64854a..a286bf01cc8c0f4d7516c50a0ecb9dda5fc84d39 100644
--- a/webrtc/base/atomicops.h
+++ b/webrtc/base/atomicops.h
@@ -44,13 +44,13 @@ class AtomicOps {
}
// Pointer variants.
template <typename T>
- static T* AtomicLoadPtr(T* volatile* ptr) {
+ static T* AcquireLoadPtr(T* volatile* ptr) {
return *ptr;
}
template <typename T>
static T* CompareAndSwapPtr(T* volatile* ptr, T* old_value, T* new_value) {
return static_cast<T*>(::InterlockedCompareExchangePointer(
- reinterpret_cast<PVOID volatile*>(ptr), old_value, new_value));
+ reinterpret_cast<PVOID volatile*>(ptr), new_value, old_value));
}
#else
static int Increment(volatile int* i) {
@@ -70,7 +70,7 @@ class AtomicOps {
}
// Pointer variants.
template <typename T>
- static T* AtomicLoadPtr(T* volatile* ptr) {
+ static T* AcquireLoadPtr(T* volatile* ptr) {
return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
}
template <typename T>
« no previous file with comments | « no previous file | webrtc/base/criticalsection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698