Lines Matching full:wait
70 mapper_async_wait* wait; member
162 mapper_async_wait* wait = data->wait; in async_wait_timeout_callback() local
166 wait->conn, NULL, "xyz.openbmc_project.ObjectMapper", in async_wait_timeout_callback()
172 async_wait_done(r, wait); in async_wait_timeout_callback()
185 mapper_async_wait* wait = data->wait; in async_wait_getobject_callback() local
188 if (wait->finished) in async_wait_getobject_callback()
203 r = sd_event_now(wait->loop, CLOCK_MONOTONIC, &next_retry); in async_wait_getobject_callback()
206 async_wait_done(r, wait); in async_wait_getobject_callback()
211 r = sd_event_add_time(wait->loop, &data->event_source, CLOCK_MONOTONIC, in async_wait_getobject_callback()
216 async_wait_done(r, wait); in async_wait_getobject_callback()
225 async_wait_done(-r, wait); in async_wait_getobject_callback()
229 for (i = 0; i < wait->count; ++i) in async_wait_getobject_callback()
231 if (!strcmp(data->path, wait->objs[i])) in async_wait_getobject_callback()
233 wait->status[i] = 1; in async_wait_getobject_callback()
237 if (async_wait_check_done(wait)) in async_wait_getobject_callback()
239 async_wait_done(0, wait); in async_wait_getobject_callback()
247 static int async_wait_get_objects(mapper_async_wait* wait) in async_wait_get_objects() argument
253 for (i = 0; i < wait->count; ++i) in async_wait_get_objects()
255 if (wait->status[i]) in async_wait_get_objects()
260 data->wait = wait; in async_wait_get_objects()
261 data->path = wait->objs[i]; in async_wait_get_objects()
265 wait->conn, NULL, "xyz.openbmc_project.ObjectMapper", in async_wait_get_objects()
268 async_wait_getobject_callback, data, "sas", wait->objs[i], 0, NULL); in async_wait_get_objects()
285 mapper_async_wait* wait = w; in async_wait_match_introspection_complete() local
286 if (wait->finished) in async_wait_match_introspection_complete()
291 r = async_wait_get_objects(wait); in async_wait_match_introspection_complete()
294 async_wait_done(r, wait); in async_wait_match_introspection_complete()
349 mapper_async_wait* wait = NULL; in mapper_wait_async() local
351 wait = malloc(sizeof(*wait)); in mapper_wait_async()
352 if (!wait) in mapper_wait_async()
357 memset(wait, 0, sizeof(*wait)); in mapper_wait_async()
358 wait->conn = conn; in mapper_wait_async()
359 wait->loop = loop; in mapper_wait_async()
360 wait->callback = callback; in mapper_wait_async()
361 wait->userdata = userdata; in mapper_wait_async()
362 wait->count = sarraylen(objs); in mapper_wait_async()
363 if (!wait->count) in mapper_wait_async()
369 wait->objs = sarraydup(objs); in mapper_wait_async()
370 if (!wait->objs) in mapper_wait_async()
376 wait->status = malloc(sizeof(*wait->status) * wait->count); in mapper_wait_async()
377 if (!wait->status) in mapper_wait_async()
382 memset(wait->status, 0, sizeof(*wait->status) * wait->count); in mapper_wait_async()
384 r = sd_bus_add_match(conn, &wait->introspection_slot, in mapper_wait_async()
386 async_wait_match_introspection_complete, wait); in mapper_wait_async()
393 r = sd_bus_add_match(conn, &wait->intf_slot, in mapper_wait_async()
395 async_wait_match_introspection_complete, wait); in mapper_wait_async()
402 r = async_wait_get_objects(wait); in mapper_wait_async()
409 *w = wait; in mapper_wait_async()
414 sd_bus_slot_unref(wait->intf_slot); in mapper_wait_async()
416 sd_bus_slot_unref(wait->introspection_slot); in mapper_wait_async()
418 free(wait->status); in mapper_wait_async()
420 sarrayfree(wait->objs); in mapper_wait_async()
422 free(wait); in mapper_wait_async()