# stdlib: Thread.Condition wake only if signaled · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9947b47d803415f40c82b6cbb510f47bc800658d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9947b47d803415f40c82b6cbb510f47bc800658d

Requested commit: 9947b47d803415f40c82b6cbb510f47bc800658d

Commit: 9947b47d803415f40c82b6cbb510f47bc800658d

Tree: 6976446b6e5f582a2469823e3a2b0b39978404ee

Author: Igor Anić

Committer: Igor Anić

## Message

```
stdlib: Thread.Condition wake only if signaled

Previous implementation didn't check whether there are pending signals
after return from futex.wait. While it is ok for broadcast case it can
result in multiple wakeups when only one thread is signaled.
This implementation checks that there are pending signals before
returning from wait.
It is similar to the original implementation but the without initial
signal check, here we first go to the futex and then check for pending
signal.

```

## Parents

- [f229b740999b58432dc49e3aa412fac14e3781f3](https://git.cafe/gitcafe/zig/commit/f229b740999b58432dc49e3aa412fac14e3781f3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9947b47d803415f40c82b6cbb510f47bc800658d?format=markdown)
