add comment to explain mysterious policy in concurrentWrapper

This commit is contained in:
Sears Russell 2010-08-25 16:37:05 +00:00
parent 9b0ee8e856
commit c2cb334506

View file

@ -72,6 +72,10 @@ static void* cwGetStaleHelper(struct replacementPolicy* impl, void*(*func)(struc
}
}
if(bucket != oldbucket) {
// note that, even on success, we increment the bucket. Otherwise, we could
// (would) eventually get unlucky, and some caller would do a getStaleAndRemove,
// fail to get a latch, insert it back, and the next getStaleAndRemove would
// deterministically return the same page again, leading to an infinite loop.
pthread_setspecific(rp->next_bucket, (void*) bucket);
}
return ret;