Changeset [a8a8f10d16ce22d69fe72e2aca8ad8da6f0f6cc7] by Reid Morrison
Revision a8a8f10d16ce22d69fe72e2aca8ad8da6f0f6cc7,
committed by Reid Morrison
· March 16th, 2017 @ 03:28 AM
Make aasm thread-safe. (#442)
Ever since AASM supported multiple named state machines in a
single
class, it has accessed and stored its state machines in class
variables.
However accesses to the state machines are not thread-safe
causing
exceptions when multiple threads attempt to access the same
state
machine at the same time during lazy initialization.
Using a Concurrent Map makes calls to state machines, and lazy
initialization thread safe.
https://github.com/aasm/aasm/commit/a8a8f10d16ce22d69fe72e2aca8ad8d...
2 changed files
-
M
aasm.gemspec -
M
lib/aasm/state_machine_store.rb