Skip to content
Snippets Groups Projects
Commit e568e7f0 authored by Ilya Verbin's avatar Ilya Verbin Committed by Vladimir Davydov
Browse files

core: get rid of unused cbus_flush

Part of #7166

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
parent b7ff1615
No related branches found
No related tags found
No related merge requests found
......@@ -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 *);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment