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

Function cs_fsm_state_set

exec/fsm.h:101–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static inline void cs_fsm_state_set (struct cs_fsm* fsm, int32_t next_state, void* data, cs_fsm_cb cb)
102{
103 int i;
104 struct cs_fsm_entry *entry = &fsm->table[fsm->curr_entry];
105
106 if (fsm->curr_state == next_state) {
107 return;
108 }
109 /*
110 * confirm that "next_state" is in the current entry's next list
111 */
112 for (i = 0; i < CS_FSM_NEXT_STATE_SIZE; i++) {
113 if (entry->next_states[i] < 0) {
114 break;
115 }
116 if (entry->next_states[i] == next_state) {
117 if (cb != NULL) {
118 cb(fsm, CS_FSM_CB_EVENT_STATE_SET, fsm->curr_state, next_state, entry->event, data);
119 }
120 fsm->curr_state = next_state;
121 return;
122 }
123 }
124 if (cb != NULL) {
125 cb(fsm, CS_FSM_CB_EVENT_STATE_SET_NF, fsm->curr_state, next_state, entry->event, data);
126 }
127}
128
129#endif /* FSM_H_DEFINED */
130

Callers 4

mon_fsm_state_setFunction · 0.85
wd_config_changedFunction · 0.85
wd_resource_failedFunction · 0.85
wd_resource_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected