
Untitled
By: a guest on
May 4th, 2012 | syntax:
None | size: 0.55 KB | hits: 11 | expires: Never
atomic {
nodes[node_id].retries = 0;
nodes[node_id].flags |= FLAG_ACCESSED;
if (--nodes_left == 0) {
node_id = call Random.rand() % NUM_NODES;
} else {
i = 0;
rand_no = call Random.rand() % nodes_left;
trace(DBG_USR1, "rand_no = %d\r\n", rand_no);
while (rand_no >= 0) {
trace (DBG_USR1, "while... rand_no=%d, i=%d\r\n", rand_no, i);
if (!(nodes[i++].flags & FLAG_ACCESSED))
--rand_no;
}
trace(DBG_USR1, "post pollnodes(%d)\r\n", i);
node_id = i;
post pollnodes();
}
}