Each action tries to acquire its own lock before the action's plan starts
# File lib/dynflow/middleware/common/singleton.rb, line 5 def plan(*args) action.singleton_lock! pass(*args) end
At the start of run we try to acquire action's lock unless it already holds it At the end the action tries to unlock its own lock if the execution plan has no
finalize phase
# File lib/dynflow/middleware/common/singleton.rb, line 13 def run(*args) action.singleton_lock! unless action.holds_singleton_lock? pass(*args) end