We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa3f151 commit f6ea863Copy full SHA for f6ea863
runnables/composite/runner.go
@@ -21,7 +21,7 @@ type Runner[T runnable] struct {
21
currentConfig atomic.Pointer[Config[T]]
22
configCallback ConfigCallback[T]
23
24
- runnablesMu sync.RWMutex
+ runnablesMu sync.Mutex
25
fsm finitestate.Machine
26
27
// will be set by Run()
@@ -145,9 +145,9 @@ func (r *Runner[T]) Run(ctx context.Context) error {
145
146
// Stop will cancel the context, causing all child runnables to stop.
147
func (r *Runner[T]) Stop() {
148
- r.runnablesMu.RLock()
+ r.runnablesMu.Lock()
149
cancel := r.cancel
150
- r.runnablesMu.RUnlock()
+ r.runnablesMu.Unlock()
151
152
if cancel == nil {
153
r.logger.Warn("Cancel function is nil, skipping Stop")
0 commit comments