pomp_loop_watchdog_enable

Function pomp_loop_watchdog_enable 

Source
pub unsafe extern "C" fn pomp_loop_watchdog_enable(
    loop_: *mut pomp_loop,
    delay: u32,
    cb: pomp_watchdog_cb_t,
    userdata: *mut c_void,
) -> c_int
Expand description

Enable watchdog on the loop. If the dispatch of the events on the loop takes longer than the given delay, the given function will be called (in an internal thread) to notify that processing is stuck. @param loop : loop. @param delay : maximum time (in ms allowed for the processing of events) @param cb : function to call when the processing took too long. @param userdata : user data for the callback. @return 0 in case of success, negative errno value in case of error.

@remarks: the function is called in the context of an internal thread and should therefore nor call other functions of the library. The intent is to provide a way to log something or kill the offending process. @remarks: it should be called only once before caling once of the ‘process’ functions.