fsm icon indicating copy to clipboard operation
fsm copied to clipboard

Fix deadlock when event fired in callback

Open yb172 opened this issue 7 years ago • 5 comments

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.

yb172 avatar Oct 27 '18 07:10 yb172

Any update on this?

andersfylling avatar Nov 28 '21 05:11 andersfylling

@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 avatar Dec 13 '21 10:12 annismckenzie

@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?

maxekman avatar Dec 13 '21 10:12 maxekman

Further discussion, see: https://github.com/looplab/fsm/issues/43

maxekman avatar Dec 13 '21 10:12 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?

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! 🎉

annismckenzie avatar Dec 13 '21 13:12 annismckenzie

Should be fixed with #88, closing this.

maxekman avatar Oct 01 '22 13:10 maxekman