Timeout stopped working for me with Duktape v2.7.0

67 Views Asked by At

I had timeouts working nicely with Duktape v2.5.0. In my duktape.h file, I appended:

#define DUK_USE_EXEC_TIMEOUT_CHECK JSduk_timeout_check // our timeout check function duk_bool_t JSduk_timeout_check(void *udata);

and in the function do the checking of time and return 1 if the time has been exceeded, else 0. It was working fine.

I have discovered that since updating to Duktape v2.7.0 it is no longer working. I have remembered to append the same two lines to the duktape.h file. But the function never gets called.

What am I missing, please?

MacOS Ventura M2 processor

I have put a trace in the function and also set a breakpoint using Xcode but it definitely is not being called. The is no problem compiling and linking.

1

There are 1 best solutions below

0
Antipole On BEST ANSWER

Found my problem... I had forgotten to set

#define DUK_USE_INTERRUPT_COUNTER

which I had previously in the duk_config.h file and which I overlooked updating.

I have now inserted this #define along with the other stuff in the duktape.h file, where it should not be overlooked.