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