Mutex locks, Read/Write locks, Condition variables and Semaphores in JavaScript