MCPcopy Create free account
hub / github.com/corosync/corosync / cs_fsm_process

Function cs_fsm_process

exec/fsm.h:80–99  ·  view source on GitHub ↗

* the table entry is defined by the state + event (curr_entry). * so cs_fsm_process() sets the entry and cs_fsm_state_set() * sets the new state. */

Source from the content-addressed store, hash-verified

78 * sets the new state.
79 */
80static inline void cs_fsm_process (struct cs_fsm *fsm, int32_t new_event, void * data, cs_fsm_cb cb)
81{
82 int32_t i;
83
84 for (i = 0; i < fsm->entries; i++) {
85 if (fsm->table[i].event == new_event &&
86 fsm->table[i].curr_state == fsm->curr_state) {
87
88 assert (fsm->table[i].handler_fn != NULL);
89 /* set current entry */
90 fsm->curr_entry = i;
91 fsm->table[i].handler_fn (fsm, new_event, data);
92 return;
93 }
94 }
95
96 if (cb != NULL) {
97 cb(fsm, CS_FSM_CB_EVENT_PROCESS_NF, fsm->curr_state, CS_FSM_STATE_NONE, new_event, data);
98 }
99}
100
101static inline void cs_fsm_state_set (struct cs_fsm* fsm, int32_t next_state, void* data, cs_fsm_cb cb)
102{

Callers 6

mem_update_stats_fnFunction · 0.85
load_update_stats_fnFunction · 0.85
mon_key_changed_cbFunction · 0.85
mon_instance_initFunction · 0.85
wd_key_changedFunction · 0.85
wd_resource_check_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected