Javascript semaphore / test-and-set / lock?
JavaScript has no locking semantics because JS is not a multi threaded language. Multiple threads can only operate concurrently in completely distinct contexts — eg. HTML5 Worker threads, or in things like multiple instances of JavaScriptCore API’s context object (I assume SpiderMonkey has a similar concept). They can’t have shared state, so in essence all … Read more