diff --git a/src/lib/core/cbus.c b/src/lib/core/cbus.c index 5d91fb948af3e42b00b1adbc8a022edb7e5839f7..06acef732caec46c1424e81d1d8aa7a63937a950 100644 --- a/src/lib/core/cbus.c +++ b/src/lib/core/cbus.c @@ -447,52 +447,6 @@ cbus_call(struct cpipe *callee, struct cpipe *caller, struct cbus_call_msg *msg, return rc; } -struct cbus_flush_msg { - struct cmsg cmsg; - bool complete; - struct fiber_cond cond; -}; - -static void -cbus_flush_perform(struct cmsg *cmsg) -{ - (void)cmsg; -} - -static void -cbus_flush_complete(struct cmsg *cmsg) -{ - struct cbus_flush_msg *msg = container_of(cmsg, - struct cbus_flush_msg, cmsg); - msg->complete = true; - fiber_cond_signal(&msg->cond); -} - -void -cbus_flush(struct cpipe *callee, struct cpipe *caller, - void (*process_cb)(struct cbus_endpoint *endpoint)) -{ - struct cmsg_hop route[] = { - {cbus_flush_perform, caller}, - {cbus_flush_complete, NULL}, - }; - struct cbus_flush_msg msg; - - cmsg_init(&msg.cmsg, route); - msg.complete = false; - fiber_cond_create(&msg.cond); - - cpipe_push(callee, &msg.cmsg); - - while (true) { - if (process_cb != NULL) - process_cb(caller->endpoint); - if (msg.complete) - break; - fiber_cond_wait(&msg.cond); - } -} - struct cbus_pair_msg { struct cmsg cmsg; void (*pair_cb)(void *);