oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package coordinator
2
3import "context"
4
5// Stop waits for RunTurn's launcher close, including namespace containment.
6// Recovery belongs to the runner journal; this runtime never resends a turn.
7func (r *Runtime) Stop(ctx context.Context) error {
8 r.mu.Lock()
9 r.stopped = true
10 cancel, done, closeErr := r.cancel, r.done, r.closeErr
11 r.mu.Unlock()
12 if cancel == nil {
13 return closeErr
14 }
15 cancel()
16 select {
17 case <-done:
18 r.mu.Lock()
19 defer r.mu.Unlock()
20 return r.closeErr
21 case <-ctx.Done():
22 return ctx.Err()
23 }
24}
25