From a6e8cebbd5012e3a81221614b937eb36e26f87c8 Mon Sep 17 00:00:00 2001 From: "sprang@webrtc.org" Date: Wed, 11 Feb 2015 15:19:08 +0000 Subject: [PATCH] Fix false positive DHECK in event_posix.cc It's OK that state is kDown when a thread is woken after being signalled; another tread might also have woken and already set the state to kDown. Even if this waking and aquiring lock has been delayed until other threads have set state to kDown and then subsequently to kUp again with a new Set() call, it's OK to just set kDown and return since this thread is returning kEventSignaled after the (new) Set() has ben called. R=pbos@webrtc.org TBR=tommi@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/36109004 Cr-Commit-Position: refs/heads/master@{#8334} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8334 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/system_wrappers/source/event_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/system_wrappers/source/event_posix.cc b/webrtc/system_wrappers/source/event_posix.cc index 2a53afac3..94fe36b6b 100644 --- a/webrtc/system_wrappers/source/event_posix.cc +++ b/webrtc/system_wrappers/source/event_posix.cc @@ -151,7 +151,7 @@ EventTypeWrapper EventPosix::Wait(unsigned long timeout) { // Be careful to only change the state if we're about to report that the // event was signaled. if (ret_val == 0) { - DCHECK(state_ == kUp); + // state_ might already be kDown, in case of multiple waiters. That's OK. state_ = kDown; }