From f8ab8727aceae3a667680737e0794eedcbc7795d Mon Sep 17 00:00:00 2001 From: jackdawm <123431751+jackdawm@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:51:38 -0400 Subject: [PATCH] d.mutex.Unlock() The logic of the function seems like a defer wouldn't unlock in order for that deferred function to handle updating the d.executing state. --- internal/internal_workflow.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/internal_workflow.go b/internal/internal_workflow.go index 30ba7aad8..1190a6596 100644 --- a/internal/internal_workflow.go +++ b/internal/internal_workflow.go @@ -1056,9 +1056,11 @@ func (d *dispatcherImpl) newState(name string) *coroutineState { func (d *dispatcherImpl) ExecuteUntilAllBlocked(deadlockDetectionTimeout time.Duration) (err error) { d.mutex.Lock() if d.closed { + d.mutex.Unlock() panic("dispatcher is closed") } if d.executing { + d.mutex.Unlock() panic("call to ExecuteUntilAllBlocked (possibly from a coroutine) while it is already running") } d.executing = true