Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_austenite/tools/bench/lib/quiet_host.sh

874 bytes, 1 run

created by r1870400018:66241, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1# Quiet-host helper for a timed run. Sourced, not executed.
2#
3# Austenite's lane builds through a slot helper that holds one of two flock files,
4# `evslot1.lock` and `evslot5.lock`, for the life of each build. A timed run takes both,
5# so no Austenite build starts beside it, and gives them up when it returns, so the
6# lane's builds run in the gaps between timed runs. The lock files are only ever opened
7# for append here: never deleted or replaced, which would orphan a held lock.
8QUIET_LOCK_DIR="${QUIET_LOCK_DIR:-$HOME/.cache/cargo-targets/claude-rc-3}"
9
10# Runs "$@" in a subshell that holds both slot locks. Blocks until it has both.
11with_quiet_host() {
12 (
13 exec 7>>"$QUIET_LOCK_DIR/evslot1.lock"
14 exec 8>>"$QUIET_LOCK_DIR/evslot5.lock"
15 flock 7
16 flock 8
17 # The command itself does not inherit the descriptors; the subshell keeps the locks.
18 "$@" 7>&- 8>&-
19 )
20}