10 #ifndef CRM_COMMON_MAINLOOP__H
11 # define CRM_COMMON_MAINLOOP__H
47 # ifndef HAVE_SIGHANDLER_T
71 # include <qb/qbipcs.h>
83 int (*
dispatch) (
const char *buffer, ssize_t length, gpointer userdata);
94 struct qb_ipcs_service_handlers *callbacks);
116 enum qb_ipc_type
type,
117 struct qb_ipcs_service_handlers *callbacks,
118 enum qb_loop_priority prio);
160 void (*callback) (
mainloop_child_t * p, pid_t pid,
int core,
int signo,
int exitcode));
167 void (*callback) (
mainloop_child_t * p, pid_t pid,
int core,
int signo,
int exitcode));
179 bool (*check)(guint));
181 # define G_PRIORITY_MEDIUM (G_PRIORITY_HIGH/2)
183 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
gboolean mainloop_add_signal(int sig, void(*dispatch)(int sig))
mainloop_io_t * mainloop_add_fd(const char *name, int priority, int fd, void *userdata, struct mainloop_fd_callbacks *callbacks)
void mainloop_timer_start(mainloop_timer_t *t)
guint mainloop_timer_set_period(mainloop_timer_t *t, guint period_ms)
void mainloop_timer_del(mainloop_timer_t *t)
gboolean mainloop_child_kill(pid_t pid)
Deprecated Pacemaker mainloop API.
void(* sighandler_t)(int)
qb_ipcs_service_t * mainloop_add_ipc_server_with_prio(const char *name, enum qb_ipc_type type, struct qb_ipcs_service_handlers *callbacks, enum qb_loop_priority prio)
Start server-side API end-point, hooked into the internal event loop.
void pcmk_drain_main_loop(GMainLoop *mloop, guint timer_ms, bool(*check)(guint))
Process main loop events while a certain condition is met.
struct mainloop_timer_s mainloop_timer_t
struct mainloop_io_s mainloop_io_t
void mainloop_child_add_with_flags(pid_t pid, int timeout, const char *desc, void *userdata, enum mainloop_child_flags, void(*callback)(mainloop_child_t *p, pid_t pid, int core, int signo, int exitcode))
struct mainloop_child_s mainloop_child_t
void mainloop_set_trigger(crm_trigger_t *source)
void mainloop_cleanup(void)
int(* dispatch)(gpointer userdata)
Dispatch function for mainloop file descriptor with data ready.
pid_t mainloop_child_pid(mainloop_child_t *child)
enum crm_ais_msg_types type
gboolean mainloop_destroy_trigger(crm_trigger_t *source)
void mainloop_timer_stop(mainloop_timer_t *t)
struct trigger_s crm_trigger_t
void * mainloop_child_userdata(mainloop_child_t *child)
struct crm_ipc_s crm_ipc_t
void(* destroy)(gpointer userdata)
Destroy function for mainloop file descriptor client data.
sighandler_t crm_signal_handler(int sig, sighandler_t dispatch)
crm_trigger_t * mainloop_add_trigger(int priority, int(*dispatch)(gpointer user_data), gpointer userdata)
Create a trigger to be used as a mainloop source.
void mainloop_del_ipc_client(mainloop_io_t *client)
bool mainloop_timer_running(mainloop_timer_t *t)
void mainloop_child_add(pid_t pid, int timeout, const char *desc, void *userdata, void(*callback)(mainloop_child_t *p, pid_t pid, int core, int signo, int exitcode))
void mainloop_trigger_complete(crm_trigger_t *trig)
crm_ipc_t * mainloop_get_ipc_client(mainloop_io_t *client)
void mainloop_clear_child_userdata(mainloop_child_t *child)
void pcmk_quit_main_loop(GMainLoop *mloop, unsigned int n)
Drain some remaining main loop events then quit it.
IPC interface to Pacemaker daemons.
void mainloop_del_fd(mainloop_io_t *client)
void mainloop_del_ipc_server(qb_ipcs_service_t *server)
mainloop_timer_t * mainloop_timer_add(const char *name, guint period_ms, bool repeat, GSourceFunc cb, void *userdata)
gboolean mainloop_destroy_signal(int sig)
mainloop_io_t * mainloop_add_ipc_client(const char *name, int priority, size_t max_size, void *userdata, struct ipc_client_callbacks *callbacks)
qb_ipcs_service_t * mainloop_add_ipc_server(const char *name, enum qb_ipc_type type, struct qb_ipcs_service_handlers *callbacks)
const char * mainloop_child_name(mainloop_child_t *child)
void(* destroy)(gpointer userdata)
Destroy function for mainloop IPC connection client data.
int(* dispatch)(const char *buffer, ssize_t length, gpointer userdata)
Dispatch function for an IPC connection used as mainloop source.
int mainloop_child_timeout(mainloop_child_t *child)