Closed cwillisf closed 6 years ago
Any chance this could get bumped? –There have been a number of cases of 'random' crashes and issues reported in the forums due to this. Here are a few I noticed, for example: https://scratch.mit.edu/discuss/topic/307677/ https://scratch.mit.edu/discuss/topic/312487/ https://scratch.mit.edu/discuss/topic/305171/ https://scratch.mit.edu/discuss/topic/312269/ https://scratch.mit.edu/discuss/topic/313729/ https://scratch.mit.edu/discuss/topic/313993/ (And there are numerous occasions I've had to explain to someone why many of my speedtest projects are giving zero for their timings, as well as why a few of my projects crash because they try to use the timer to know when to leave non-refresh.)
The recent changes made in #1396, intended to fix performance problems on Flash version 30, also introduced a timing problem in Scratch threads running in warp mode. Timekeeping was wrong in such cases, leading to incorrect timer block results (see #1397) and causing minutes-long or even permanent hangs in some projects.
This change resolves #1397 by correcting the timekeeping for warp-mode threads, removes the potential for hangs, and also simplifies the thread iteration count estimation math.
I suggest testing this code against at least these three projects:
CC @TheLogFather