Re:Show HN: State Trooper – Tiny, no frills state machine fo...
by rowls66 on Saturday June 17, 2023 @12:53PM
(#36371965)
Interesting. I wrote almost the same code for work a couple of weeks ago.
Not sore, but it looks like the Transition function has a race condition. It calls CanTansition() before acquiring the mutex lock. I think this could lead to illegal state transitions.
Not sore, but it looks like the Transition function has a race condition. It calls CanTansition() before acquiring the mutex lock. I think this could lead to illegal state transitions.