public EntryIterator fetchReady() { buildGraph(); Entry readyHead = null; Entry readyTail = null; Entry p = replayOrderHead; while (p != null) { Entry next = p.replayNext; if (p.isReady()) { unlinkFromReplayList(p); if (readyTail != null) { readyTail.replayNext = p; p.replayPrev = readyTail; } else { p.replayPrev = null; readyHead = p; } readyTail = p; p.replayNext = null; } p = next; } // we need the hash-table lookups for parents, so this must be done // out of the loop where we check isReadyToRun() for (p = readyHead; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); unlinkFromLinkList(p); } return readyHead != null ? new EntryIterator(readyHead) : null; }
public EntryIterator fetchReady() { buildGraph(); Entry readyHead = null; Entry readyTail = null; Entry p = replayOrderHead; while (p != null) { Entry next = p.replayNext; if (p.isReady()) { unlinkFromReplayList(p); if (readyTail != null) { readyTail.replayNext = p; p.replayPrev = readyTail; } else { p.replayPrev = null; readyHead = p; } readyTail = p; p.replayNext = null; } p = next; } // we need the hash-table lookups for parents, so this must be done // out of the loop where we check isReadyToRun() for (p = readyHead; p != null; p = p.replayNext) { removeFromMap(p.getProcId()); unlinkFromLinkList(p); } return readyHead != null ? new EntryIterator(readyHead) : null; }
private Entry addToLinkList(Entry entry, Entry linkHead) { unlinkFromLinkList(entry); entry.linkNext = linkHead; entry.linkPrev = null; if (linkHead != null) { linkHead.linkPrev = entry; } return entry; }
public boolean remove(long procId) { trackProcIds(procId); Entry entry = removeFromMap(procId); if (entry != null) { unlinkFromReplayList(entry); unlinkFromLinkList(entry); return true; } return false; }
public boolean remove(long procId) { trackProcIds(procId); Entry entry = removeFromMap(procId); if (entry != null) { unlinkFromReplayList(entry); unlinkFromLinkList(entry); return true; } return false; }
private Entry addToLinkList(Entry entry, Entry linkHead) { unlinkFromLinkList(entry); entry.linkNext = linkHead; entry.linkPrev = null; if (linkHead != null) { linkHead.linkPrev = entry; } return entry; }