-
Notifications
You must be signed in to change notification settings - Fork 6
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
Pause on <C-c> #5
Comments
If performance is not critical you can do the following: # somewhere before the main loop of the emulator
let trap = Trap(&[SIGINT]);
loop {
try!(self.step());
if let Some(SIGINT) = trap.wait(Instant::now()) {
# break it on signal
}
} This isn't very performant as it requires a (pretty cheap) system call on every loop iteration. Better idea would be to set |
That's what I did, but it doesn't work, the code in the |
Just added an example https://github.com/tailhook/signal/blob/master/examples/poll_for_signal.rs Works fine when run as a command |
Hum, for some reason my terminal window was fucked-up and was not processing correctly. Thanks! |
Just one more question: if an interrupt is triggered while |
Sure. The signal will be "pending" until |
Cool |
Hum: I just noticed that the trap doesn't work it there is the rendering thread running. The |
BTW, you could improve the doc by putting the |
https://github.com/Yamakaky/dcpu/blob/da059ff416b6fbefe230aa64f13b00dbfc4e3481/src/emulator/debugger/mod.rs#L298-L311
It's an the
continue
loop of an emulator. Basically, it executes a function until there is an error. I would like to handle to manually pause the execution. How would you do that?The text was updated successfully, but these errors were encountered: