Modify EventPosix to prevent spurious wakeups.

pthread_cond_{timedwait,wait} are allowed to spuriously wake up as if
they were signaled. To prevent this being interpreted as a "real"
signaling of the event (ThreadWrapper for instance depends on it being
an actual signal) we need to check whether the event was actually
signalled or not.

BUG=4413
R=andresp@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8752}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8752 4adac7df-926f-26a2-2b94-8c16560cd09d
2 files changed