lib/lock.js
function tick(key) {
    var next;
    if (waiting[key]) {
        //there's somone waiting for this resource
        if (!locks[key]) {
            locks[key] = true;
            stats.lock_add();
            next = waiting[key].shift();
            if (waiting[key].length === 0) {
                //nobody is waiting for this resource anymore, clean it up
                delete waiting[key];
            }
            next(key);
        }
    }
}
function tick(key) {
    var next;
    if (waiting[key]) {
        //there's somone waiting for this resource
        if (!locks[key]) {
            locks[key] = true;
            stats.lock_add();
            next = waiting[key].shift();
            if (waiting[key].length === 0) {
                //nobody is waiting for this resource anymore, clean it up
                delete waiting[key];
            }
            next(key);
        }
    }
}
function tick ( key ) { var next ; if ( waiting [ key ] ) { //there's somone waiting for this resource if ( ! locks [ key ] ) { locks [ key ] = true ; stats . lock_add ( ) ; next = waiting [ key ] . shift ( ) ; if ( waiting [ key ] . length === 0 ) { //nobody is waiting for this resource anymore, clean it up delete waiting [ key ] ; } next ( key ) ; } } }
cycle the waiting list for one resource
cycle the waiting list for one resource