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
Implemented sys_game_watchdog syscalls #12815
Conversation
Needs more suggestions |
Uh, there are thread safety issues and bugs with emulation stopping at this state. |
The watchdog is supposed to restart the game. Also, I've observed that some arcade games rely on the watchdog to make the game itself restarted, by stopping calling sys_game_watchdog_clear(). |
As for the emulation stopping bug, I was referring to the fact that the watchdog thread operation leaks even after GUI emulation stopping request is being issued, potentially restarting other applications in this time frame. |
How about changing |
Neither, it should be manged by a named_thread held by FXO and joined on emulation stopping implicitly by its destructor. |
This is also a race condition. |
Hmm. Maybe I can make another PR to optimize it later. Would you mind providing some examples of your suggestion? |
If I understand correctly, you want the watchdog thread to be terminated/destroyed immediately right after the game is stopped, right? |
Yes, and make the state of watchdog packed in a single atomic variable and updated atomically with fused error checking with its single atomic update. |
Any examples would be appreciated. |
I implemented three sys_game_watchdog syscalls (sys_game_watchdog_start, sys_game_watchdog_stop, and sys_game_watchdog_clear) as a few games seem to rely on the watchdog to reboot the game itself.