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

nemu,device: poll the SDL event out of the signal handler #7

Merged
1 commit merged into from
Feb 22, 2016

Conversation

ghost
Copy link

@ghost ghost commented Feb 22, 2016

  • SDL_PollEvent() may eventually call malloc(), therefore it is
    not async singal safe, which may cause deadlock in malloc().
  • timer_intr() should be called in the signal handler, else hlt()
    will get stuck.
  • Now device_update() should be called in the for loop of cpu_exec()
    to finish the bottom half of the signal handler.
  • This patch will fix issue Keyboard event may cause nemu deadlock #4.

* SDL_PollEvent() may eventually call malloc(), therefore it is
  not async singal safe, which may cause deadlock in malloc().
* timer_intr() should be called in the signal handler, else hlt()
  will get stuck.
* Now device_update() should be called in the for loop of cpu_exec()
  to finish the bottom half of the signal handler.
* This patch will fix issue #4.
ghost pushed a commit that referenced this pull request Feb 22, 2016
nemu,device: poll the SDL event out of the signal handler
@ghost ghost merged commit 7df28c5 into master Feb 22, 2016
@ghost ghost deleted the malloc-deadlock branch February 22, 2016 12:16
@ghost ghost mentioned this pull request Feb 22, 2016
This pull request was closed.
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