That is an astute observation. Stepping through the code with the threads
stopping execution at the points in code you suggest would indeed make it so
take() would return the lower priority compactionRequest, remove the higher
priority compaction request from regionsInQueue, and finally the add
I was thinking along the same lines. Adding an additional synchronization
didn't seem like the right approach. So if we make sure we are taking off what
we are expecting to then there wont be a problem.
~Jeff
On Sep 28, 2010, at 2:41 PM, Ted Yu wrote:
> Except for remove(Object r), all call