Expect deadlocks in web applications now? I wouldn't necessarily trust a JS programmer with a lock, sorry. They are hard enough in C++ or other languages that generally require a lot more discipline.
Or at least made it easier. I think I introducing locks is a mistake for the browser.
Also, you don't need to use this API to lock up your web app.