Handle EINTR for io_uring

Fixes #26 specifically, we are still missing similar handling in other
places.
parent db7ccd60
......@@ -541,6 +541,9 @@ fellow_io_wait_completions(fellow_ioctx_t *ctxp,
if (cb && advance)
cb(priv, results - advance, advance);
assert(ctx->outstanding >= advance);
ctx->outstanding -= advance;
/*
* XXX if we are called from under a lock (for the multithreaded
* case in fellow_cache.c) we should unlock while waiting,
......@@ -560,12 +563,14 @@ fellow_io_wait_completions(fellow_ioctx_t *ctxp,
else
r = 0;
//lint -e{731} XXX
XXXAN(r >= 0);
if (r < 0) {
assert(errno == EINTR);
continue;
}
assert(r >= 0);
u = (typeof(u))r;
assert(ctx->outstanding >= advance);
ctx->outstanding -= advance;
assert(u <= ctx->unsubmitted);
ctx->outstanding += u;
ctx->unsubmitted -= u;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment