4 /* This needs to be implemented by each backend */
6 #ifdef HAVE_FSMONITOR_DAEMON_BACKEND
8 struct fsmonitor_daemon_state
;
11 * Initialize platform-specific data for the fsmonitor health thread.
12 * This will be called from the main thread PRIOR to staring the
15 * Returns 0 if successful.
16 * Returns -1 otherwise.
18 int fsm_health__ctor(struct fsmonitor_daemon_state
*state
);
21 * Cleanup platform-specific data for the health thread.
22 * This will be called from the main thread AFTER joining the thread.
24 void fsm_health__dtor(struct fsmonitor_daemon_state
*state
);
27 * The main body of the platform-specific event loop to monitor the
28 * health of the daemon process. This will run in the health thread.
30 * The health thread should call `ipc_server_stop_async()` if it needs
31 * to cause a shutdown. (It should NOT do so if it receives a shutdown
34 * It should set `state->health_error_code` to -1 if the daemon should exit
37 void fsm_health__loop(struct fsmonitor_daemon_state
*state
);
40 * Gently request that the health thread shutdown.
41 * It does not wait for it to stop. The caller should do a JOIN
44 void fsm_health__stop_async(struct fsmonitor_daemon_state
*state
);
46 #endif /* HAVE_FSMONITOR_DAEMON_BACKEND */
47 #endif /* FSM_HEALTH_H */