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

Unified Diff: webrtc/base/criticalsection.cc

Issue 1420043008: Create rtc::AtomicInt POD struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: intentional obliteration of the unintentional whitespace of doom Created 5 years, 1 month 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 | « webrtc/base/criticalsection.h ('k') | webrtc/base/refcount.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/criticalsection.cc
diff --git a/webrtc/base/criticalsection.cc b/webrtc/base/criticalsection.cc
index 1f50c2355dbcef57b016f31dcc8c68501b9a84ca..3cf4fed447c26b2c5a153f0c711ea893ecf0380f 100644
--- a/webrtc/base/criticalsection.cc
+++ b/webrtc/base/criticalsection.cc
@@ -139,7 +139,7 @@ void GlobalLockPod::Lock() {
const struct timespec ts_null = {0};
#endif
- while (AtomicOps::CompareAndSwap(&lock_acquired, 0, 1)) {
+ while (AtomicInt::CompareAndSwap(&lock_acquired, 0, 1)) {
#if defined(WEBRTC_WIN)
::Sleep(0);
#else
@@ -149,16 +149,11 @@ void GlobalLockPod::Lock() {
}
void GlobalLockPod::Unlock() {
- int old_value = AtomicOps::CompareAndSwap(&lock_acquired, 1, 0);
+ int old_value = AtomicInt::CompareAndSwap(&lock_acquired, 1, 0);
RTC_DCHECK_EQ(1, old_value) << "Unlock called without calling Lock first";
}
-GlobalLock::GlobalLock() {
- lock_acquired = 0;
-}
-
-GlobalLockScope::GlobalLockScope(GlobalLockPod* lock)
- : lock_(lock) {
+GlobalLockScope::GlobalLockScope(GlobalLockPod* lock) : lock_(lock) {
lock_->Lock();
}
« no previous file with comments | « webrtc/base/criticalsection.h ('k') | webrtc/base/refcount.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698