MCPcopy Index your code
hub / github.com/coder/coder / WithReapLock

Function WithReapLock

agent/reaper/reaper.go:70–74  ·  view source on GitHub ↗

WithReapLock sets a mutex shared between the reaper and Wait4. The reaper holds the write lock while reaping, and ForkReap holds the read lock during Wait4, preventing the reaper from stealing the child's exit status. This is only needed for tests with instant-exit children where the race window is

(mu *sync.RWMutex)

Source from the content-addressed store, hash-verified

68// tests with instant-exit children where the race window is
69// large.
70func WithReapLock(mu *sync.RWMutex) Option {
71 return func(o *options) {
72 o.ReapLock = mu
73 }
74}
75
76type options struct {
77 ExecArgs []string

Callers 2

TestReapFunction · 0.92
TestForkReapExitCodesFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestReapFunction · 0.74
TestForkReapExitCodesFunction · 0.74