Skip to content

Commit

Permalink
check user interrupt on until timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Oct 21, 2023
1 parent 331b457 commit d606b6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ SEXP rnng_cv_until2(SEXP cvar, SEXP msec) {
break;
}

uint8_t signalled = 1;
int signalled = 1;
nng_mtx_lock(mtx);
while (ncv->condition == 0) {
if (nng_cv_until(cv, time) == NNG_ETIMEDOUT) {
Expand All @@ -1735,6 +1735,7 @@ SEXP rnng_cv_until2(SEXP cvar, SEXP msec) {
}
if (signalled) ncv->condition--;
nng_mtx_unlock(mtx);
if (!signalled) R_CheckUserInterrupt();

return Rf_ScalarLogical(signalled);

Expand Down

0 comments on commit d606b6b

Please sign in to comment.