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

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

Issue 2128583003: Remove unused CriticalSection::IsLocked() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | webrtc/base/criticalsection.cc » ('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 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 public: 56 public:
57 CriticalSection(); 57 CriticalSection();
58 ~CriticalSection(); 58 ~CriticalSection();
59 59
60 void Enter() const EXCLUSIVE_LOCK_FUNCTION(); 60 void Enter() const EXCLUSIVE_LOCK_FUNCTION();
61 bool TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true); 61 bool TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true);
62 void Leave() const UNLOCK_FUNCTION(); 62 void Leave() const UNLOCK_FUNCTION();
63 63
64 // Use only for RTC_DCHECKing. 64 // Use only for RTC_DCHECKing.
65 bool CurrentThreadIsOwner() const; 65 bool CurrentThreadIsOwner() const;
66 // Use only for RTC_DCHECKing.
67 bool IsLocked() const;
68 66
69 private: 67 private:
70 #if defined(WEBRTC_WIN) 68 #if defined(WEBRTC_WIN)
71 mutable CRITICAL_SECTION crit_; 69 mutable CRITICAL_SECTION crit_;
72 #elif defined(WEBRTC_POSIX) 70 #elif defined(WEBRTC_POSIX)
73 #if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC 71 #if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC
74 // Number of times the lock has been locked + number of threads waiting. 72 // Number of times the lock has been locked + number of threads waiting.
75 // TODO(tommi): We could use this number and subtract the recursion count 73 // TODO(tommi): We could use this number and subtract the recursion count
76 // to find places where we have multiple threads contending on the same lock. 74 // to find places where we have multiple threads contending on the same lock.
77 mutable volatile int lock_queue_; 75 mutable volatile int lock_queue_;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 explicit GlobalLockScope(GlobalLockPod* lock) EXCLUSIVE_LOCK_FUNCTION(lock); 143 explicit GlobalLockScope(GlobalLockPod* lock) EXCLUSIVE_LOCK_FUNCTION(lock);
146 ~GlobalLockScope() UNLOCK_FUNCTION(); 144 ~GlobalLockScope() UNLOCK_FUNCTION();
147 private: 145 private:
148 GlobalLockPod* const lock_; 146 GlobalLockPod* const lock_;
149 RTC_DISALLOW_COPY_AND_ASSIGN(GlobalLockScope); 147 RTC_DISALLOW_COPY_AND_ASSIGN(GlobalLockScope);
150 }; 148 };
151 149
152 } // namespace rtc 150 } // namespace rtc
153 151
154 #endif // WEBRTC_BASE_CRITICALSECTION_H_ 152 #endif // WEBRTC_BASE_CRITICALSECTION_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/criticalsection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698