Skip to content

Commit c3f4f5c

Browse files
committed
fix: reduce frequency of interruption checks
1 parent 5b6c210 commit c3f4f5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rinterface_extra.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,9 @@ void checkInterruptFn(void *dummy) {
23482348
}
23492349

23502350
int R_igraph_interrupt_handler(void *data) {
2351+
static int iter = 0;
2352+
if (++iter < 16) return IGRAPH_SUCCESS;
2353+
iter = 0;
23512354
/* We need to call R_CheckUserInterrupt() regularly to enable interruptions.
23522355
* However, if an interruption is pending, R_CheckUserInterrupt() will
23532356
* longjmp back to the top level so we cannot clean up ourselves by calling

0 commit comments

Comments
 (0)