Skip to content

Commit 8a2901b

Browse files
committed
PR review
1 parent 3f5c888 commit 8a2901b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/rebuild-lock.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,10 @@ export function withRebuildLock(work: () => void): void {
6969
} finally {
7070
release(fd);
7171
}
72+
} else {
73+
// A third (or later) waiter lost the race to reacquire the lock after the
74+
// first holder finished. Another process is now rebuilding — wait for it
75+
// to release before returning, so the caller can safely load the binary.
76+
waitForLockRelease();
7277
}
7378
}

0 commit comments

Comments
 (0)