RFR: 8209976: Improve iteration over non-JavaThreads

Roman Kennke rkennke at redhat.com
Tue Aug 28 17:38:10 UTC 2018


Looks good to me too.

Roman

> 
> This looks good.  Thank you for making Thread class abstract.
> 
> Coleen
> 
> On 8/27/18 9:36 PM, Kim Barrett wrote:
>>> On Aug 27, 2018, at 2:08 PM, coleen.phillimore at oracle.com wrote:
>>>
>>>
>>> This looks like a good improvement.  So there are either JavaThreads
>>> or NonJavaThreads but no Thread now?   Should Thread be made abstract
>>> so it cannot be instantiated?
>> Thanks for reviewing.
>>
>> We don’t ever directly instantiate Thread.  I can make it abstract.
>>
>> The canonical way to make a class abstract if it isn't already seems
>> to be to make the virtual destructor pure. Below is the diff from
>> open.01 that I'm running through testing.
>>
>> diff -r 7587d014de95 src/hotspot/share/runtime/thread.hpp
>> --- a/src/hotspot/share/runtime/thread.hpp    Mon Aug 27 13:17:40 2018
>> -0400
>> +++ b/src/hotspot/share/runtime/thread.hpp    Mon Aug 27 21:20:05 2018
>> -0400
>> @@ -385,7 +385,7 @@
>>       // Constructor
>>     Thread();
>> -  virtual ~Thread();
>> +  virtual ~Thread() = 0;        // Thread is abstract.
>>       // Manage Thread::current()
>>     void initialize_thread_current();
>>
>>> thanks,
>>> Coleen
>>>
>>> On 8/27/18 1:34 PM, Kim Barrett wrote:
>>>>> On Aug 27, 2018, at 12:09 PM, Kim Barrett <kim.barrett at oracle.com>
>>>>> wrote:
>>>>> Hm, except that I seem to have forgotten to remove the
>>>>> now obsolete asserts from GlobalCounter::critical_section_begin/end.
>>>> New webrevs:
>>>> full: http://cr.openjdk.java.net/~kbarrett/8209976/open.01/
>>>> incr: http://cr.openjdk.java.net/~kbarrett/8209976/open.01.inc/
>>
> 




More information about the hotspot-dev mailing list