Ejemplo n.º 1
0
 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);
     }
   }
 }
Ejemplo n.º 2
0
 public final int immediateRequestCount() {
   synchronized (immediateRequests) {
     return immediateRequests.getNodeCount();
   }
 }