Remove unused CriticalSection::IsLocked()

Review-Url: https://codereview.webrtc.org/2128583003
Cr-Commit-Position: refs/heads/master@{#13409}
This commit is contained in:
andresp
2016-07-08 01:19:35 -07:00
committed by Commit bot
parent 4c0536bd51
commit 388d8e92b8
3 changed files with 0 additions and 31 deletions

View File

@ -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(); }

View File

@ -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)

View File

@ -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)