boostorg / msm

Boost.org msm module
http://boost.org/libs/msm
31 stars 53 forks source link

Fix UB for multiple instances of one state machine #42

Closed joergczeranski closed 1 year ago

joergczeranski commented 3 years ago

Don't re-initialize flags_entries every time get_entries_for_flag is called, only once per function template instance. This fixes a write-write race condition (undefined behavior) when multiple threads/strands instantiate the same state machine.