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, ...@@ -541,6 +541,9 @@ fellow_io_wait_completions(fellow_ioctx_t *ctxp,
if (cb && advance) if (cb && advance)
cb(priv, results - advance, 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 * XXX if we are called from under a lock (for the multithreaded
* case in fellow_cache.c) we should unlock while waiting, * case in fellow_cache.c) we should unlock while waiting,
...@@ -560,12 +563,14 @@ fellow_io_wait_completions(fellow_ioctx_t *ctxp, ...@@ -560,12 +563,14 @@ fellow_io_wait_completions(fellow_ioctx_t *ctxp,
else else
r = 0; r = 0;
//lint -e{731} XXX if (r < 0) {
XXXAN(r >= 0); assert(errno == EINTR);
continue;
}
assert(r >= 0);
u = (typeof(u))r; u = (typeof(u))r;
assert(ctx->outstanding >= advance);
ctx->outstanding -= advance;
assert(u <= ctx->unsubmitted); assert(u <= ctx->unsubmitted);
ctx->outstanding += u; ctx->outstanding += u;
ctx->unsubmitted -= 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