# std.Thread.Condition: optimize example · gitcafe/zig

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

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

Visibility: public

Requested revision: 1617138c721120d4543a0a5b392c979ec9e8956d

Requested commit: 1617138c721120d4543a0a5b392c979ec9e8956d

Commit: 1617138c721120d4543a0a5b392c979ec9e8956d

Tree: 55cbdbf0ea5ba484a3fa7cbac8afdbd4b7a6b4fd

Author: Erik Arvstedt

Committer: Andrew Kelley

## Message

```
std.Thread.Condition: optimize example

- Hold the lock for a shorter amount of time
- Previously, when holding the lock while signaling, the other, resumed
  thread could potentially get suspended again immediately because
  the mutex was still locked.
- Fix comment

```

## Parents

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

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