Remove unused CriticalSection::IsLocked()
Review-Url: https://codereview.webrtc.org/2128583003 Cr-Commit-Position: refs/heads/master@{#13409}
This commit is contained in:
@ -180,18 +180,6 @@ bool CriticalSection::CurrentThreadIsOwner() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CriticalSection::IsLocked() const {
|
||||
#if defined(WEBRTC_WIN)
|
||||
return crit_.LockCount != -1;
|
||||
#else
|
||||
#if CS_DEBUG_CHECKS
|
||||
return thread_ != 0;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
CritScope::CritScope(const CriticalSection* cs) : cs_(cs) { cs_->Enter(); }
|
||||
CritScope::~CritScope() { cs_->Leave(); }
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ class LOCKABLE CriticalSection {
|
||||
|
||||
// Use only for RTC_DCHECKing.
|
||||
bool CurrentThreadIsOwner() const;
|
||||
// Use only for RTC_DCHECKing.
|
||||
bool IsLocked() const;
|
||||
|
||||
private:
|
||||
#if defined(WEBRTC_WIN)
|
||||
|
||||
@ -306,23 +306,6 @@ TEST(CriticalSectionTest, Basic) {
|
||||
EXPECT_EQ(0, runner.shared_value());
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
|
||||
TEST(CriticalSectionTest, IsLocked) {
|
||||
// Simple single-threaded test of IsLocked.
|
||||
CriticalSection cs;
|
||||
EXPECT_FALSE(cs.IsLocked());
|
||||
cs.Enter();
|
||||
EXPECT_TRUE(cs.IsLocked());
|
||||
cs.Leave();
|
||||
EXPECT_FALSE(cs.IsLocked());
|
||||
if (!cs.TryEnter())
|
||||
FAIL();
|
||||
EXPECT_TRUE(cs.IsLocked());
|
||||
cs.Leave();
|
||||
EXPECT_FALSE(cs.IsLocked());
|
||||
}
|
||||
#endif
|
||||
|
||||
class PerfTestData {
|
||||
public:
|
||||
PerfTestData(int expected_count, Event* event)
|
||||
|
||||
Reference in New Issue
Block a user