rtc::CriticalSection: Add dummy implementation of IsLocked for release builds

In release mode, DCHECK still references the condition before throwing it away, so the function needs to be defined.

R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50779004

Cr-Commit-Position: refs/heads/master@{#9070}
This commit is contained in:
Magnus Jedvert
2015-04-23 16:06:59 +02:00
parent 24d4485614
commit 7f287cca67

View File

@@ -105,9 +105,13 @@ class LOCKABLE CriticalSection {
#endif // CS_TRACK_OWNER
}
// Use only for DCHECKing.
bool IsLocked() {
#if CS_TRACK_OWNER
bool IsLocked() { return thread_ != 0; }
return thread_ != 0;
#else
return true;
#endif
}
private:
pthread_mutex_t mutex_;