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

Signal handling not implemented for native threads #16746

Closed
richard-uk1 opened this issue Aug 25, 2014 · 5 comments
Closed

Signal handling not implemented for native threads #16746

richard-uk1 opened this issue Aug 25, 2014 · 5 comments

Comments

@richard-uk1
Copy link
Contributor

I can't find anything in the docs about signal handling for native threads.

@alexcrichton
Copy link
Member

Dupe of #11203.

@richard-uk1
Copy link
Contributor Author

My apologies

@richard-uk1
Copy link
Contributor Author

Note: the following program also fails for me (using n-m model)

extern crate debug;

use std::io::signal::{Listener, Interrupt};

fn main() {
    let mut sig_listener = Listener::new();
    let io_result = sig_listener.register(Interrupt);
    println!("{:?}", io_result);
    while match sig_listener.rx.recv() {
        Interrupt => {
            println!("Registered interrupt signal");
            false
        },
        _ => true,
    } {}
}

prints

Err(std::io::IoError{kind: IoUnavailable, desc: "function not implemented", detail: Some(collections::string::String{vec: collections::vec::Vec<u8>{len: 61u, cap: 128u, ptr: (0x7f990e410180 as *mut ())}})})

@alexcrichton
Copy link
Member

No worries! Sometimes it's pretty tough to find existing issues.

Your example program needs to link to libgreen in order to use the M:N model.

@richard-uk1
Copy link
Contributor Author

Thanks for the help! It led me to this: http://doc.rust-lang.org/guide-runtime.html, which is the guide to all the scheduling stuff (for anyone else).

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

No branches or pull requests

2 participants