Skip to content

Commit f6ea863

Browse files
committed
restore previous runnablesMu type to normal mutex, no need for rwmutex
1 parent aa3f151 commit f6ea863

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runnables/composite/runner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Runner[T runnable] struct {
2121
currentConfig atomic.Pointer[Config[T]]
2222
configCallback ConfigCallback[T]
2323

24-
runnablesMu sync.RWMutex
24+
runnablesMu sync.Mutex
2525
fsm finitestate.Machine
2626

2727
// will be set by Run()
@@ -145,9 +145,9 @@ func (r *Runner[T]) Run(ctx context.Context) error {
145145

146146
// Stop will cancel the context, causing all child runnables to stop.
147147
func (r *Runner[T]) Stop() {
148-
r.runnablesMu.RLock()
148+
r.runnablesMu.Lock()
149149
cancel := r.cancel
150-
r.runnablesMu.RUnlock()
150+
r.runnablesMu.Unlock()
151151

152152
if cancel == nil {
153153
r.logger.Warn("Cancel function is nil, skipping Stop")

0 commit comments

Comments
 (0)