Moving lock removal code to cortexLocks.js
This commit is contained in:
parent
f84a926317
commit
9153c0896b
|
@ -204,7 +204,7 @@ function packResults(res) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
function removeNodeRangeLocks(addr) {
|
||||
for(var i in rangeLocks) {
|
||||
log("freeing " + i + " locks");
|
||||
|
@ -219,6 +219,7 @@ function removeNodeRangeLocks(addr) {
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function disconnect(addr) {
|
||||
/* log("--------------DISCONNECT " + addr + "----------");
|
||||
|
@ -241,7 +242,7 @@ function disconnect(addr) {
|
|||
}
|
||||
}
|
||||
// range locks
|
||||
removeNodeRangeLocks(addr);
|
||||
//removeNodeRangeLocks(addr);
|
||||
|
||||
log("disconnect: freeing range locks");
|
||||
}
|
||||
|
|
|
@ -72,3 +72,28 @@ function handleAddLock(resp) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeNodeRangeLocks(addr) {
|
||||
for(var i in rangeLocks) {
|
||||
log("freeing " + i + " locks");
|
||||
var rlock = rangeLocks[i];
|
||||
while (rlock != null) {
|
||||
log("looking at " + i + " (" + rlock.start + " to " + rlock.end + ") : " + rlock.addr);
|
||||
if (rlock.addr == addr) {
|
||||
log("unlocking");
|
||||
rlock.locked = false;
|
||||
}
|
||||
rlock = rlock.next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeNodeLocks(addr) {
|
||||
removeNodeRangeLocks(resp['addr']);
|
||||
}
|
||||
|
||||
addMsgHandler("deadNode",
|
||||
function (resp) {
|
||||
removeNodeLocks(resp['addr']);
|
||||
});
|
Loading…
Reference in New Issue