Merge branch 'tb/send-email-extract-valid-address-error-message-fix' into maint-2.42
[git/gitster.git] / compat / fsmonitor / fsm-health.h
blob45547ba93804a90d3b8b399a072d26d041db0c09
1 #ifndef FSM_HEALTH_H
2 #define FSM_HEALTH_H
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
13 * thread.
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
32 * shutdown signal.)
34 * It should set `state->health_error_code` to -1 if the daemon should exit
35 * with an error.
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
42 * to wait for it.
44 void fsm_health__stop_async(struct fsmonitor_daemon_state *state);
46 #endif /* HAVE_FSMONITOR_DAEMON_BACKEND */
47 #endif /* FSM_HEALTH_H */