Closed mvdnes closed 10 years ago
Using timers with libnative on Linux is broken right now. #12689
I doubt that #12689 is the cause of this problem. While using usleep
is broken, it's won't cause a failure or memory safety issue (except in a contrived example). I think sleeping/timers needs to be redesigned rather than just patched up though.
@thestinger True. Timers do show strange behavior on libnative though.
I was able to trigger the same error message in the following code:
extern crate native;
fn main() {
native::task::spawn(proc() customtask());
}
fn customtask() {
let mut timer = std::io::timer::Timer::new().unwrap();
let periodic = timer.periodic(100);
periodic.recv();
}
Thanks! I'll investigate soon.
Error
Version
Latest nightly (
rust-nightly_201403040405~3c0d098~precise_amd64.deb
) fromhttp://ppa.launchpad.net/hansjorg/rust/
:Additional information
This error happens in my Gameboy color emulator https://github.com/mvdnes/rboy, after switching from the 'normal' starting and spawning. The problem started when I switched to spawning my thread with libnative. (Another stange thing, when starting main in native my SDL window would not quit.) I use timer::periodic to slow down the emulator. Given the error, I assume that is the place the error could lie.