glib::source

Function child_watch_add_local

Source
pub fn child_watch_add_local<F>(pid: Pid, func: F) -> SourceId
where F: FnMut(Pid, i32) + 'static,
Expand description

Adds a closure to be called by the main loop the returned Source is attached to when a child process exits.

func will be called when pid exits

Different to child_watch_add(), this does not require func to be Send but can only be called from the thread that owns the main context.

This function panics if called from a different thread than the one that owns the main context.