|
From: | Brent W. Baccala |
Subject: | Re: race condition destroying condition variables |
Date: | Wed, 27 Dec 2017 15:07:51 -0500 |
Hello,
Brent W. Baccala, on mar. 26 déc. 2017 23:06:13 -0500, wrote:
> Also, the Linux source code in nptl/ includes the following comment:
>
> /* If there are waiters which have been already signalled or
> broadcasted, but still are using the pthread_cond_t structure,
> pthread_cond_destroy needs to wait for them. */
Ok, so even if Posix explicitly says that it has undefined behavior,
since nptl behaves fine we should probably behave fine too.
Thus, we can assume that all waiters that are still accessing the condvar have been woken. We wait until they have confirmed to have woken up by decrementing __wrefs.
[Prev in Thread] | Current Thread | [Next in Thread] |