Function std::task::unkillable

pub fn unkillable<U>(f: &fn() -> U) -> U

Temporarily make the task unkillable

Example

do task::unkillable {
    // detach / deschedule / destroy must all be called together
    rustrt::rust_port_detach(po);
    // This must not result in the current task being killed
    task::deschedule();
    rustrt::rust_port_destroy(po);
}