So that you could do.
locks.lock("something", function() {
locks.unlock("something");
});
// etc
Detecting when a mutex no longer has anything in its queue and can therefore be removed is actually quite complex, and the user has to maintain a map of all their mutexes to keys.