Using an atomic makes more sense.  This class predates my reading of
your book  ;-)  Although, looking at this again, I'm embarrassed to
admit I'm not sure *why* synchronizing on incr doesn't do anything.
Because I'm reassigning it?

> Slight problem with newUniqueID(), though. Synchronizing on incr doesn't do
> anything. How about using AtomicLong and masking out the high bits?

Reply via email to