Skip to content

rvvm: Restart the eventloop thread after it stops on its own - #326

Open
BeastLe9enD wants to merge 1 commit into
LekKit:stagingfrom
ProjectKML:eventloop-restart
Open

BeastLe9enD wants to merge 1 commit into
LekKit:stagingfrom
ProjectKML:eventloop-restart

Conversation

@BeastLe9enD

Copy link
Copy Markdown

When the last running machine powers off, the eventloop thread finds no machines left and returns, but eventloop_thread keeps pointing at it. The next rvvm_start_machine() sees a thread handle and does not create a new one, so the restarted machine runs without an eventloop: hart timers are not checked, devices are not updated and a later power-off is never processed. The machine then stays running with its power state off, and every further rvvm_start_machine() fails.

Record under global_lock that the threaded eventloop exited by itself and let rvvm_reconfigure_eventloop() join that thread before deciding whether to create a new one.

Oh and I apologize for the PR spam of course 😆

When the last running machine powers off, the eventloop thread finds no
machines left and returns, but eventloop_thread keeps pointing at it. The
next rvvm_start_machine() sees a thread handle and does not create a new
one, so the restarted machine runs without an eventloop: hart timers are
not checked, devices are not updated and a later power-off is never
processed. The machine then stays running with its power state off, and
every further rvvm_start_machine() fails.

Record under global_lock that the threaded eventloop exited by itself and
let rvvm_reconfigure_eventloop() join that thread before deciding whether
to create a new one.
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

Successfully merging this pull request may close these issues.

1 participant