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

Core: Reset Wiimotes/rumble/memwatcher on emu thread #8518

Merged
merged 2 commits into from Dec 13, 2019

Conversation

stenzek
Copy link
Contributor

@stenzek stenzek commented Dec 9, 2019

This was causing a race which was crashing the FifoCI runners. The main thread called Stop() which in turn called ResetAllWiimotes() while the emu thread was still exiting, also shutting down the Wiimote class.

By shifting the reset to the emu thread, all cleanup operations happen on the same thread where they were initialized.

The whole startup/shutdown situation is not an ideal design anyway (e.g. the join() in Start()...). But at least this fixes the "random" crashes.

I'd make Stop() simply block until the emu thread shuts down, but if any part of the shutdown requires window messages to be pumped, as Stop() is called from the UI thread it'll deadlock. So probably requires some more thinking.

This was causing a race which was crashing the FifoCI runners. The main
thread called Stop() which in turn called ResetAllWiimotes() while the
emu thread was still exiting, also shutting down the Wiimote class.

By shifting the reset to the emu thread, all cleanup operations happen
on the same thread where they were initialized.
@stenzek
Copy link
Contributor Author

stenzek commented Dec 9, 2019

Related to #8504, regression from #8224. I think this could potentially happen in the Qt frontend as well, but not consistently as it's a race.

@stenzek stenzek merged commit a980a39 into dolphin-emu:master Dec 13, 2019
@stenzek stenzek deleted the more-wiimote-reset-crashes branch December 13, 2019 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant