RFR (S): CR 8005926: (thread) Merge ThreadLocalRandom state into java.lang.Thread (original) (raw)

Martin Buchholz martinrb at google.com
Tue Feb 19 17:48:28 UTC 2013


On Wed, Jan 16, 2013 at 7:01 AM, Chris Hegarty <chris.hegarty at oracle.com>wrote:

Thanks to all for the reviews and suggestions here. As you probably seen, I pushed these changes to jdk8/tl earlier today (sorry, I missed Alan as an official reviewer on the changeset.). Consider it an initial version, pending any outcome from this, or other, discussions.

Also, 8006409: "ThreadLocalRandom should dropping padding fields from its serialized form", has been filed to follow up on the changes required to update the serial form. For those watching, I was preferable to push on with these changes ( and I apologize if it appeared pushy ), as the Double/Long Adder/Accumulator implementation, Striped64, now has a dependency on this change. It has become unbearable to keep in sync with different version of across different repositories.

Taking a look at this, I don't see any reason why we can't simply do (while maintaining serialization compatibility):

diff --git a/src/share/classes/java/util/concurrent/ThreadLocalRandom.java b/src/share/classes/java/util/concurrent/ThreadLocalRandom.java --- a/src/share/classes/java/util/concurrent/ThreadLocalRandom.java +++ b/src/share/classes/java/util/concurrent/ThreadLocalRandom.java @@ -368,50 +368,6 @@ private static final long serialVersionUID = -5851777807851030925L;

 /**

serializes it). - */ - private void writeObject(java.io.ObjectOutputStream out) - throws java.io.IOException {



More information about the core-libs-dev mailing list