# std: Call pthread_atfork only once · gitcafe/zig

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

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

Visibility: public

Requested revision: abfe7f96dd45e22d43c3e14ed64e1fbb8e94b419

Requested commit: abfe7f96dd45e22d43c3e14ed64e1fbb8e94b419

Commit: abfe7f96dd45e22d43c3e14ed64e1fbb8e94b419

Tree: e4283d3203940eb4588d8c87f12964ad6902dfb7

Author: LemonBoy

Committer: LemonBoy

## Message

```
std: Call pthread_atfork only once

Some libc implementations (glib) deduplicate identical hooks, others
(musl, macos) do not and blindly append them to an internal list.
Ensure there's only a single call to pthread_atfork to prevent unbounded
memory use when lots of threads/forks are used.

```

## Parents

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

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