lancaster-university / codal-core

MIT License
11 stars 28 forks source link

Ensure AnimatedDisplay::waitForFreeDisplay() is free of race conditions #140

Closed martinwork closed 1 year ago

martinwork commented 3 years ago

Update to the internal AnimatedDisplay::waitForFreeDisplay() method to ensure that fibers queued waiting for access to the display always re-contest for access, thereby avoiding potential race conditions.

martinwork commented 2 years ago

@JohnVidler Please see this example https://makecode.microbit.org/_Jkr8AxRj0VuT. V1, V2 and the simulator all behave differently. I'm not sure which is right between simulator and V1, but V2 is definitely wrong. I think this PR would make V2 like V1.