Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. atomic {
  2.                         nodes[node_id].retries = 0;
  3.                         nodes[node_id].flags |= FLAG_ACCESSED;
  4.                         if (--nodes_left == 0) {
  5.                                 node_id = call Random.rand() % NUM_NODES;
  6.                         } else {
  7.                                 i = 0;
  8.                                 rand_no = call Random.rand() % nodes_left;
  9.                                 trace(DBG_USR1, "rand_no = %d\r\n", rand_no);
  10.  
  11.                                 while (rand_no >= 0) {
  12.                                         trace (DBG_USR1, "while... rand_no=%d, i=%d\r\n", rand_no, i);
  13.                                         if (!(nodes[i++].flags & FLAG_ACCESSED))
  14.                                                 --rand_no;
  15.                                 }
  16.                                 trace(DBG_USR1, "post pollnodes(%d)\r\n", i);
  17.                                 node_id = i;
  18.                                 post pollnodes();
  19.                         }
  20.                 }