RFR [9] 8056152 API to create Threads that do not inherit InheritableThreadLocals

Mandy Chung mandy.chung at oracle.com
Tue Dec 8 20:53:47 UTC 2015


> On Dec 8, 2015, at 12:28 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> 
>> 
>> Since this is target for advanced users, what’s your thought of defining a new subclass extending Thread?
> 
> I don't have a strong objection against a new subclass, but I seems like overkill for something so simple, given there is already low-level / advanced details exposed in the current API, like stack size. Unless you are thinking of creating a new home for other Thread and thread-local related operations, that could be added subsequently?

I am not thinking of any new thread-local related operation.  The boolean inheritThreadLocals argument is added to one single constructor that forces the caller to pass the null/zero or other default value is not ideal.

Since the audience of this API would be small, defining a new class with the appropriate constructors (perhaps no stackSize) is a good alternative.  The change would still be simple.

Mandy


More information about the core-libs-dev mailing list