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

Unified Diff: webrtc/base/criticalsection.cc

Issue 1453093002: Revert of Create rtc::AtomicInt POD struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 3cf4fed447c26b2c5a153f0c711ea893ecf0380f..1f50c2355dbcef57b016f31dcc8c68501b9a84ca 100644
--- a/webrtc/base/criticalsection.cc
+++ b/webrtc/base/criticalsection.cc
@@ -139,7 +139,7 @@
const struct timespec ts_null = {0};
#endif
- while (AtomicInt::CompareAndSwap(&lock_acquired, 0, 1)) {
+ while (AtomicOps::CompareAndSwap(&lock_acquired, 0, 1)) {
#if defined(WEBRTC_WIN)
::Sleep(0);
#else
@@ -149,11 +149,16 @@
}
void GlobalLockPod::Unlock() {
- int old_value = AtomicInt::CompareAndSwap(&lock_acquired, 1, 0);
+ int old_value = AtomicOps::CompareAndSwap(&lock_acquired, 1, 0);
RTC_DCHECK_EQ(1, old_value) << "Unlock called without calling Lock first";
}
-GlobalLockScope::GlobalLockScope(GlobalLockPod* lock) : lock_(lock) {
+GlobalLock::GlobalLock() {
+ lock_acquired = 0;
+}
+
+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