It is possible that some task is waiting for space to open up in the
send queue, so we need to give it a chance to run.
static void
do_tx_work(struct rconn *rc)
{
+ if (!rc->txq.n) {
+ return;
+ }
while (rc->txq.n > 0) {
int error = try_send(rc);
if (error) {
break;
}
}
+ if (!rc->txq.n) {
+ poll_immediate_wake();
+ }
}
static unsigned int
static void
flush_queue(struct rconn *rc)
{
+ if (!rc->txq.n) {
+ return;
+ }
while (rc->txq.n > 0) {
struct buffer *b = queue_pop_head(&rc->txq);
int *n_queued = b->private;
}
buffer_delete(b);
}
+ poll_immediate_wake();
}
static unsigned int