lib/lock.js
function wait(key, cb) {
    if (!waiting[key]) {
        waiting[key] = [];
    }

    waiting[key].push(cb);
}
function wait(key, cb) {
    if (!waiting[key]) {
        waiting[key] = [];
    }

    waiting[key].push(cb);
}
function wait ( key , cb ) { if ( ! waiting [ key ] ) { waiting [ key ] = [ ] ; } waiting [ key ] . push ( cb ) ; }
register a handler for a resource
the handler will be called when nobody before it is waiting
for that resoruce
register a handler for a resource the handler will be called when nobody before it is waiting for that resoruce