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

Side by Side Diff: webrtc/base/sharedexclusivelock.h

Issue 1345433002: Add RTC_ prefix to contructormagic macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Formatting fix. Created 5 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/scopedptrcollection_unittest.cc ('k') | webrtc/base/signalthread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 18 matching lines...) Expand all
29 void UnlockExclusive() UNLOCK_FUNCTION(); 29 void UnlockExclusive() UNLOCK_FUNCTION();
30 void LockShared(); 30 void LockShared();
31 void UnlockShared(); 31 void UnlockShared();
32 32
33 private: 33 private:
34 rtc::CriticalSection cs_exclusive_; 34 rtc::CriticalSection cs_exclusive_;
35 rtc::CriticalSection cs_shared_; 35 rtc::CriticalSection cs_shared_;
36 rtc::Event shared_count_is_zero_; 36 rtc::Event shared_count_is_zero_;
37 int shared_count_; 37 int shared_count_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(SharedExclusiveLock); 39 RTC_DISALLOW_COPY_AND_ASSIGN(SharedExclusiveLock);
40 }; 40 };
41 41
42 class SCOPED_LOCKABLE SharedScope { 42 class SCOPED_LOCKABLE SharedScope {
43 public: 43 public:
44 explicit SharedScope(SharedExclusiveLock* lock) SHARED_LOCK_FUNCTION(lock) 44 explicit SharedScope(SharedExclusiveLock* lock) SHARED_LOCK_FUNCTION(lock)
45 : lock_(lock) { 45 : lock_(lock) {
46 lock_->LockShared(); 46 lock_->LockShared();
47 } 47 }
48 48
49 ~SharedScope() UNLOCK_FUNCTION() { lock_->UnlockShared(); } 49 ~SharedScope() UNLOCK_FUNCTION() { lock_->UnlockShared(); }
50 50
51 private: 51 private:
52 SharedExclusiveLock* lock_; 52 SharedExclusiveLock* lock_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(SharedScope); 54 RTC_DISALLOW_COPY_AND_ASSIGN(SharedScope);
55 }; 55 };
56 56
57 class SCOPED_LOCKABLE ExclusiveScope { 57 class SCOPED_LOCKABLE ExclusiveScope {
58 public: 58 public:
59 explicit ExclusiveScope(SharedExclusiveLock* lock) 59 explicit ExclusiveScope(SharedExclusiveLock* lock)
60 EXCLUSIVE_LOCK_FUNCTION(lock) 60 EXCLUSIVE_LOCK_FUNCTION(lock)
61 : lock_(lock) { 61 : lock_(lock) {
62 lock_->LockExclusive(); 62 lock_->LockExclusive();
63 } 63 }
64 64
65 ~ExclusiveScope() UNLOCK_FUNCTION() { lock_->UnlockExclusive(); } 65 ~ExclusiveScope() UNLOCK_FUNCTION() { lock_->UnlockExclusive(); }
66 66
67 private: 67 private:
68 SharedExclusiveLock* lock_; 68 SharedExclusiveLock* lock_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(ExclusiveScope); 70 RTC_DISALLOW_COPY_AND_ASSIGN(ExclusiveScope);
71 }; 71 };
72 72
73 } // namespace rtc 73 } // namespace rtc
74 74
75 #endif // WEBRTC_BASE_SHAREDEXCLUSIVELOCK_H_ 75 #endif // WEBRTC_BASE_SHAREDEXCLUSIVELOCK_H_
OLDNEW
« no previous file with comments | « webrtc/base/scopedptrcollection_unittest.cc ('k') | webrtc/base/signalthread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698