Skip to content

Conversation

@benkuper
Copy link

This proposes a fix for the issue #1445

The execute() function sets an interrupt in the engine that is then checked whenever a function is called using callFunction, but the interval in the interrupt check function is calculated depending on the time at execute(), not the time at callFunction(), resulting in an inevitable interrupt if we keep calling functions after having calling execute() once.

This fix store a "timeAtLastStart" variable that replaces the lambda-local "started" argument. This way, it is effectively updated everytime an evaluate / execute / callFunction is used, without having to redefine the engine interrupt handler everytime.

A more complete and possibly elegant implementation would be to keep track of which thread has called what and have different checks for each thread, so they can be treated independently. But this fix is way simpler and should be good for most cases.

benkuper added 27 commits June 22, 2024 19:53
This also updates the UnitTest to include those types
@benkuper benkuper closed this Oct 17, 2024
@benkuper benkuper deleted the bugfix/javascriptInterrupt branch October 17, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant