JavaScript in the browser is famously single-threaded, unless you add web-workers, which have a very specific way of interacting with your main script. The code is stupid on its face, but it's actually advanced stupid. First off, check/assign of a variable wouldn't be atomic so the wouldn't act as a lock.
5 Comments
Sort: