Skip to content
Snippets Groups Projects
Commit b8f87f55 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

cbus: fix cbus_endpoint_destroy loop exit condition

ipc_cond_wait() always returns 0, so the body of the loop waiting for
the endpoint to be ready for destruction is only invoked once.
parent 12c1328e
No related branches found
No related tags found
No related merge requests found
......@@ -226,11 +226,14 @@ cbus_endpoint_destroy(struct cbus_endpoint *endpoint,
rlist_del(&endpoint->in_cbus);
tt_pthread_mutex_unlock(&cbus.mutex);
do {
while (true) {
if (process_cb)
process_cb(endpoint);
} while ((endpoint->n_pipes > 0 || !stailq_empty(&endpoint->output)) &&
ipc_cond_wait(&endpoint->cond));
if (endpoint->n_pipes == 0 && stailq_empty(&endpoint->output))
break;
ipc_cond_wait(&endpoint->cond);
}
/*
* Pipe flush func can still lock mutex, so just lock and unlock
* it.
......
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