Compare commits

...

2 Commits

Author SHA1 Message Date
Scott Baxter 3d41990d52
Merge 2885c1cf35 into b97926675a 2026-01-23 21:04:17 -08:00
Scott Baxter 2885c1cf35 fix: Worker no longer leaves defunct pid on macOS 2025-05-03 21:41:05 -05:00
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ function _p9k_worker_main() {
# usage: _p9k_worker_async <work> <callback> # usage: _p9k_worker_async <work> <callback>
function _p9k_worker_async() { function _p9k_worker_async() {
local fd async=$1 local fd async=$1
sysopen -r -o cloexec -u fd <(() { eval $async; } && print -n '\x1e') || return (print -n '\x1e' &)
pid=$!
wait $pid || return 1
(( ++_p9k_worker_inflight[$_p9k_worker_request_id] )) (( ++_p9k_worker_inflight[$_p9k_worker_request_id] ))
_p9k_worker_fds[$fd]=$_p9k_worker_request_id$'\x1f'$2 _p9k_worker_fds[$fd]=$_p9k_worker_request_id$'\x1f'$2
} }