mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
16 lines
302 B
Bash
Executable File
16 lines
302 B
Bash
Executable File
#!/bin/bash
|
|
set -u
|
|
dir=${ANYPS5_COMPILE_SLOT_DIR:?}
|
|
slots=${ANYPS5_COMPILE_SLOTS:?}
|
|
while :; do
|
|
for ((i = 0; i < slots; i++)); do
|
|
[ -e "$dir/slot-$i" ] || : >> "$dir/slot-$i"
|
|
exec {fd}<"$dir/slot-$i"
|
|
if flock -n "$fd"; then
|
|
exec "$@"
|
|
fi
|
|
exec {fd}>&-
|
|
done
|
|
sleep 0.1
|
|
done
|