fsm
fsm copied to clipboard
Fix deadlock when event fired in callback
Fixes #36
Changes:
- Do check if there is a transition going on also before acquiring event lock
- Add test case to verify no deadlock is happening when event is fired in callback
I'm not sure if that is safe to remove second check (after acquiring stateMu lock) so I just added one more before locks.
Any update on this?
@andersfylling you can give our forked version a try: https://github.com/alfaview/fsm/pull/1. I want to upstream this but I haven't gotten around to discussing whether that's possible with @maxekman.
@annismckenzie Definitely possible to upstream the changes, only problem is that I have limited time for reviewing. Perhaps if you could provide a PR here and involve the interested parties in the review?
Further discussion, see: https://github.com/looplab/fsm/issues/43
@annismckenzie Definitely possible to upstream the changes, only problem is that I have limited time for reviewing. Perhaps if you could provide a PR here and involve the interested parties in the review?
Sounds like a plan! All 3 commits I did in the in-repo pull request for one of my team mates to review can be pulled into their own PR individually (they all have a passing test suite). I'll send the first later today. Thank you for being open to contributions! 🎉
Should be fixed with #88, closing this.