# std: improve std.once tests · gitcafe/zig

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

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

Visibility: public

Requested revision: ff18103ef6d383b6c6f81d996925f3a7856851e9

Requested commit: ff18103ef6d383b6c6f81d996925f3a7856851e9

Commit: ff18103ef6d383b6c6f81d996925f3a7856851e9

Tree: 9945d6abc1ed66b8c47e5b04e751f204bfd391cf

Author: Alex Kladov

Committer: Andrew Kelley

## Message

```
std: improve std.once tests

* fix UB when Thread.spawn fails, and we try to join uninitialized
  threads (through new `thread_count` variable).
* make sure that the tests pins down synchronization guarantees: in the
  main thread, we can observe `1` due to synchronization from
  `Thread.join()`. To make sure that once uses Acq/Rel, and not just
  relaxed, we should also additionally check that each thread observes
  1, regardless of whether it was the one to call once.

```

## Parents

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

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