glibmm 2.78.0
Public Member Functions | List of all members
Glib::SignalChildWatch Class Reference

#include <glibmm/main.h>

Public Member Functions

sigc::connection connect (const sigc::slot< void(GPid, int)> & slot, GPid pid, int priority=PRIORITY_DEFAULT)
 Connects a child watch handler. More...

Member Function Documentation

◆ connect()

sigc::connection Glib::SignalChildWatch::connect ( const sigc::slot< void(GPid, int)> &  slot,
GPid  pid,
int  priority = PRIORITY_DEFAULT 

Connects a child watch handler.

void child_watch_handler(GPid pid, int child_status) { ... }
Glib::signal_child_watch().connect(sigc::ptr_fun(&child_watch_handler), pid);
pointer_to_unary_function< _Arg, _Result > ptr_fun(_Result(*__x)(_Arg))
sigc::connection connect(const sigc::slot< void(GPid, int)> &slot, GPid pid, int priority=PRIORITY_DEFAULT)
Connects a child watch handler.
SignalChildWatch signal_child_watch()
Convenience child watch signal.

This method is not thread-safe. You should call it, or manipulate the returned sigc::connection object, only from the thread where the SignalChildWatch object's MainContext runs.

slotA slot to call when child process pid exited.
pidThe child process to watch for.
priorityThe priority of the new event source.
A connection handle, which can be used to disconnect the handler.