# Module: rewrite zir caching logic · gitcafe/zig

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

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

Visibility: public

Requested revision: e3cf9d165081533524927cebf8a92ac6fee097f2

Requested commit: e3cf9d165081533524927cebf8a92ac6fee097f2

Commit: e3cf9d165081533524927cebf8a92ac6fee097f2

Tree: fa2c60e017e3fb75019d53e579dfe2c8c2e15998

Author: Jacob Young

Committer: Andrew Kelley

## Message

```
Module: rewrite zir caching logic

Multiple processes can sit waiting for the exclusive lock at the same
time, so we want to recheck whether it needs to be updated whenever
we get an exclusive lock.

This also fixes a race condition between one process truncating the
cache file and another process reading it without atomic locking.

```

## Parents

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

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