提交 e487c203 编写于 作者: R Rich Felker

fix breakage in pthread_cond_wait due to typo

due to accidental use of = instead of ==, the error code was always
set to zero in the signaled wake case for non-shared cv waits.
suppressing ETIMEDOUT (the only possible wait error) is harmless and
actually permitted in this case, but suppressing mutex errors could
give the caller false information about the state of the mutex.

commit 8741ffe6 introduced this
regression and commit d9da1fb8
preserved it when reorganizing the code.
上级 34b423d2
...@@ -163,7 +163,7 @@ relock: ...@@ -163,7 +163,7 @@ relock:
a_dec(&m->_m_waiters); a_dec(&m->_m_waiters);
/* Since a signal was consumed, cancellation is not permitted. */ /* Since a signal was consumed, cancellation is not permitted. */
if (e = ECANCELED) e = 0; if (e == ECANCELED) e = 0;
done: done:
__pthread_setcancelstate(cs, 0); __pthread_setcancelstate(cs, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册