提交 16ef9d02 编写于 作者: E Emilio G. Cota 提交者: Paolo Bonzini

qemu-thread: handle spurious futex_wait wakeups

Signed-off-by: NEmilio G. Cota <cota@braap.org>
Message-Id: <1440375847-17603-12-git-send-email-cota@braap.org>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 090d0bfd
......@@ -298,7 +298,16 @@ static inline void futex_wake(QemuEvent *ev, int n)
static inline void futex_wait(QemuEvent *ev, unsigned val)
{
futex(ev, FUTEX_WAIT, (int) val, NULL, NULL, 0);
while (futex(ev, FUTEX_WAIT, (int) val, NULL, NULL, 0)) {
switch (errno) {
case EWOULDBLOCK:
return;
case EINTR:
break; /* get out of switch and retry */
default:
abort();
}
}
}
#else
static inline void futex_wake(QemuEvent *ev, int n)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册