Skip to content

Commit

Permalink
Make the state hash fully thread safe
Browse files Browse the repository at this point in the history
Fixes issue described here: ruby-concurrency/concurrent-ruby#970
  • Loading branch information
mensfeld committed Nov 20, 2022
1 parent 8b1e421 commit bc0c836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/finite_machine/hooks.rb
Expand Up @@ -18,7 +18,7 @@ class Hooks
def initialize
@hooks_map = Concurrent::Map.new do |events_hash, hook_event|
events_hash[hook_event] = Concurrent::Map.new do |state_hash, name|
state_hash[name] = []
state_hash.compute_if_absent(name) { [] }
end
end
end
Expand Down

0 comments on commit bc0c836

Please sign in to comment.