public final void request(int type, int id) { if ((type >= 0) && (type <= fileVersions.length) && (id >= 0) && (id <= fileVersions[type].length) && (fileVersions[type][id] != 0)) { synchronized (immediateRequests) { for (OnDemandNode onDemandNode = (OnDemandNode) immediateRequests.reverseGetFirst(); onDemandNode != null; onDemandNode = (OnDemandNode) immediateRequests.reverseGetNext()) { if ((onDemandNode.type == type) && (onDemandNode.id == id)) { return; } } OnDemandNode ondemandnode = new OnDemandNode(); ondemandnode.type = type; ondemandnode.id = id; ondemandnode.immediate = true; synchronized (wanted) { wanted.insertBack(ondemandnode); } immediateRequests.insertHead(ondemandnode); } } }
public final int immediateRequestCount() { synchronized (immediateRequests) { return immediateRequests.getNodeCount(); } }