From 6f314bbbb9ffe9bd55e6e8181792482d5a83d954 Mon Sep 17 00:00:00 2001 From: Tommi Date: Mon, 4 Dec 2017 20:38:20 +0100 Subject: [PATCH] Convert an RTC_DCHECK to logging an error in debug builds. Removing the check as they were causing some tests to fail. Bug: none Change-Id: I42878d93a3239b18e3807a77bffc597794b65bf1 TBR: ossu@webrtc.org Reviewed-on: https://webrtc-review.googlesource.com/29300 Commit-Queue: Tommi Reviewed-by: Tommi Cr-Commit-Position: refs/heads/master@{#21055} --- rtc_base/thread.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc index 35507e0b32..749334125f 100644 --- a/rtc_base/thread.cc +++ b/rtc_base/thread.cc @@ -65,8 +65,12 @@ Thread *ThreadManager::CurrentThread() { return static_cast(pthread_getspecific(key_)); } -void ThreadManager::SetCurrentThread(Thread *thread) { - RTC_DCHECK(!CurrentThread() || !thread); +void ThreadManager::SetCurrentThread(Thread* thread) { +#if RTC_DLOG_IS_ON + if (CurrentThread() && thread) { + RTC_DLOG(LS_ERROR) << "SetCurrentThread: Overwriting an existing value?"; + } +#endif // RTC_DLOG_IS_ON pthread_setspecific(key_, thread); } #endif