Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition #4

Open
Johnlon opened this issue Oct 16, 2016 · 2 comments
Open

Race condition #4

Johnlon opened this issue Oct 16, 2016 · 2 comments

Comments

@Johnlon
Copy link

Johnlon commented Oct 16, 2016

If Dice.playdice() drops into the follow branch before the takeLeadership callback occurs then the program hangs without generating any dice rolls.

This is because the first block of code in follow() has a loop condition that never breaks out.
ie "while (ledgers == null) "

A potential solution is to change the condition to so that one the leadership
"while (ledgers == null && !leader)"

Or is this additional check wrong for some reason?

@Johnlon
Copy link
Author

Johnlon commented Oct 16, 2016

See pull request

@ivankelly
Copy link
Owner

@Johnlon for some reason github didn't send me a notification for this. I'm updating the tutorial for the new api, so will add this fix as I go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants