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

Function sync_init

exec/sync.c:158–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 struct sync_callbacks *callbacks);
157
158int sync_init (
159 int (*sync_callbacks_retrieve) (
160 int service_id,
161 struct sync_callbacks *callbacks),
162 void (*synchronization_completed) (void))
163{
164 unsigned int res;
165
166 res = totempg_groups_initialize (
167 &sync_group_handle,
168 sync_deliver_fn,
169 NULL);
170 if (res == -1) {
171 log_printf (LOGSYS_LEVEL_ERROR,
172 "Couldn't initialize groups interface.");
173 return (-1);
174 }
175
176 res = totempg_groups_join (
177 sync_group_handle,
178 &sync_group,
179 1);
180 if (res == -1) {
181 log_printf (LOGSYS_LEVEL_ERROR, "Couldn't join group.");
182 return (-1);
183 }
184
185 sync_synchronization_completed = synchronization_completed;
186 my_sync_callbacks_retrieve = sync_callbacks_retrieve;
187
188 return (0);
189}
190
191static void sync_barrier_handler (unsigned int nodeid, const void *msg)
192{

Callers 1

main_service_readyFunction · 0.85

Calls 2

totempg_groups_joinFunction · 0.85

Tested by

no test coverage detected