Killable

Trait Killable 

pub unsafe trait Killable {
    // Required method
    fn pthread_handle(&self) -> u64;

    // Provided method
    fn kill(&self, num: i32) -> Result<(), Error> { ... }
}
Expand description

Trait for threads that can be signalled via pthread_kill.

Note that this is only useful for signals between SIGRTMIN() and SIGRTMAX() because these are guaranteed to not be used by the C runtime.

§Safety

This is marked unsafe because the implementation of this trait must guarantee that the returned pthread_t is valid and has a lifetime at least that of the trait object.

Required Methods§

fn pthread_handle(&self) -> u64

Cast this killable thread as pthread_t.

Provided Methods§

fn kill(&self, num: i32) -> Result<(), Error>

Send a signal to this killable thread.

§Arguments
  • num: specify the signal

Implementations on Foreign Types§

§

impl<T> Killable for JoinHandle<T>

§

fn pthread_handle(&self) -> u64

Implementors§