diff --git a/services/capture/deltacast-bridge/main.c b/services/capture/deltacast-bridge/main.c index f9176ba..b36dd6f 100644 --- a/services/capture/deltacast-bridge/main.c +++ b/services/capture/deltacast-bridge/main.c @@ -280,7 +280,11 @@ int main(int argc, char *argv[]) { * (already bind-mounted into every capture sidecar) to guarantee only * one bridge runs OpenBoardHandle + signal-wait at a time. The lock is * released after signal lock succeeds (plus a settle delay) or on - * failure — so the next bridge is never permanently blocked. */ + * failure — so the next bridge is never permanently blocked. + * + * IMPORTANT: the signal-wait deadline is set AFTER acquiring the lock so + * the full sig_timeout is available for signal detection regardless of + * how long this bridge waited in the queue. */ const char *lock_path = "/dev/shm/deltacast/bridge.lock"; int lock_fd = open(lock_path, O_CREAT | O_RDWR, 0666); if (lock_fd >= 0) { @@ -313,7 +317,9 @@ int main(int argc, char *argv[]) { VHD_SetBoardProperty(board, loopback_prop(port_id), FALSE); } - /* ── Wait for signal lock ──────────────────────────────────────── */ + /* ── Wait for signal lock ────────────────────────────────────────── + * Deadline is set HERE — after the flock is acquired and the board is + * open — so the full sig_timeout is available regardless of queue wait. */ ULONG video_std = (ULONG)NB_VHD_VIDEOSTANDARDS; struct timespec deadline; clock_gettime(CLOCK_MONOTONIC, &deadline);