From 7f287cca67a8183eeabee774f1178d76176ed807 Mon Sep 17 00:00:00 2001 From: Magnus Jedvert Date: Thu, 23 Apr 2015 16:06:59 +0200 Subject: [PATCH] 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} --- webrtc/base/criticalsection.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webrtc/base/criticalsection.h b/webrtc/base/criticalsection.h index 0b4bb1505..1891f83bb 100644 --- a/webrtc/base/criticalsection.h +++ b/webrtc/base/criticalsection.h @@ -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_;