Replace ProcessSemaphore (counting semaphore with N slots) with advisory flock on .beads/dolt-access.lock. Readers acquire shared locks (concurrent), writers acquire exclusive locks (serialized). This prevents multiple bd processes from competing for dolt internal LOCK file, which caused zombie hangs. Key changes: - Add FlockSharedNonBlock/FlockExclusiveNonBlock to lockfile package (unix/windows/wasm) - Add AccessLock with poll-based acquisition and configurable timeout - Integrate lock acquire/release in DoltStore.New()/Close() and error paths - Replace ProcessSemaphore in main.go with OpenTimeout (5s read, 15s write) - Remove dead ProcessSemaphore code Co-Authored-By: beads/crew/lydia <steve.yegge@gmail.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/emma Rig: beads Role: crew
15 lines
323 B
Go
15 lines
323 B
Go
//go:build js && wasm
|
|
|
|
package lockfile
|
|
|
|
import "os"
|
|
|
|
// FlockSharedNonBlock is a no-op in WASM (single-process environment).
|
|
func FlockSharedNonBlock(f *os.File) error {
|
|
return nil
|
|
}
|
|
|
|
// FlockExclusiveNonBlock is a no-op in WASM (single-process environment).
|
|
func FlockExclusiveNonBlock(f *os.File) error {
|
|
return nil
|
|
}
|