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

Unified Diff: webrtc/base/criticalsection.h

Issue 1420043008: Create rtc::AtomicInt POD struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: ctor version, let's pray they are put in .data or .bss 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
Index: webrtc/base/criticalsection.h
diff --git a/webrtc/base/criticalsection.h b/webrtc/base/criticalsection.h
index ddbf857f2b15cc49bca4c13e72a011fcc4b7d87b..5e8bfdb35a27ad40e7464e6c5c06742a1210e2bf 100644
--- a/webrtc/base/criticalsection.h
+++ b/webrtc/base/criticalsection.h
@@ -102,11 +102,12 @@ class TryCritScope {
// No custom constructor or private data member should be added.
class LOCKABLE GlobalLockPod {
public:
+ GlobalLockPod() : lock_acquired(0) {}
void Lock() EXCLUSIVE_LOCK_FUNCTION();
void Unlock() UNLOCK_FUNCTION();
- volatile int lock_acquired;
+ AtomicInt lock_acquired;
};
class GlobalLock : public GlobalLockPod {

Powered by Google App Engine
This is Rietveld 408576698