Re: RFR: 8201327: Make Sensor deeply immutably thread safe

2018-04-10 Thread Martin Buchholz
On Mon, Apr 9, 2018 at 7:13 PM, Martin Buchholz  wrote:

>
>
> On Mon, Apr 9, 2018 at 1:25 PM, Chris Hegarty 
> wrote:
>
>>
>> > except maybe the "initially false" and "initially 0" comments as they
>> are just documenting the default values and don't add anything.
>>
>> Yeah, I’ve done this before too, especially when removing default values
>> ( as if to prevent them from inadvertently creeping back in ).
>>
>
> If only there was standard concise wording for "intentionally using the
> field's default value, which is slightly more efficient and slightly more
> theoretically thread-safe, even though slightly less readable" ...
>
> // VM-initialized to false
>

I'm committing with the hinting wording

// VM-initialized to false


Re: RFR: 8201327: Make Sensor deeply immutably thread safe

2018-04-09 Thread Martin Buchholz
On Mon, Apr 9, 2018 at 1:25 PM, Chris Hegarty 
wrote:

>
> > On 9 Apr 2018, at 20:31, Alan Bateman  wrote:
> >
> >> On 09/04/2018 18:54, Martin Buchholz wrote:
> >> Another little cleanup to make Google's race detector happy.
> >>
> >> 8201327: Make Sensor deeply immutably thread safe
> >> http://cr.openjdk.java.net/~martin/webrevs/jdk/Sensor-init/ <
> http://cr.openjdk.java.net/%7Emartin/webrevs/jdk/Sensor-init/>
> >> https://bugs.openjdk.java.net/browse/JDK-8201327
> >>
> > This looks okay to me,
>
> +1
>
> > except maybe the "initially false" and "initially 0" comments as they
> are just documenting the default values and don't add anything.
>
> Yeah, I’ve done this before too, especially when removing default values (
> as if to prevent them from inadvertently creeping back in ).
>

If only there was standard concise wording for "intentionally using the
field's default value, which is slightly more efficient and slightly more
theoretically thread-safe, even though slightly less readable" ...

// VM-initialized to false


Re: RFR: 8201327: Make Sensor deeply immutably thread safe

2018-04-09 Thread Chris Hegarty

> On 9 Apr 2018, at 20:31, Alan Bateman  wrote:
> 
>> On 09/04/2018 18:54, Martin Buchholz wrote:
>> Another little cleanup to make Google's race detector happy.
>> 
>> 8201327: Make Sensor deeply immutably thread safe
>> http://cr.openjdk.java.net/~martin/webrevs/jdk/Sensor-init/ 
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8201327
>> 
> This looks okay to me,

+1

> except maybe the "initially false" and "initially 0" comments as they are 
> just documenting the default values and don't add anything.

Yeah, I’ve done this before too, especially when removing default values ( as 
if to prevent them from inadvertently creeping back in ).

-Chris.


Re: RFR: 8201327: Make Sensor deeply immutably thread safe

2018-04-09 Thread Alan Bateman

On 09/04/2018 18:54, Martin Buchholz wrote:

Another little cleanup to make Google's race detector happy.

8201327: Make Sensor deeply immutably thread safe
http://cr.openjdk.java.net/~martin/webrevs/jdk/Sensor-init/ 


https://bugs.openjdk.java.net/browse/JDK-8201327

This looks okay to me, except maybe the "initially false" and "initially 
0" comments as they are just documenting the default values and don't 
add anything.


-Alan.


RFR: 8201327: Make Sensor deeply immutably thread safe

2018-04-09 Thread Martin Buchholz
Another little cleanup to make Google's race detector happy.

8201327: Make Sensor deeply immutably thread safe
http://cr.openjdk.java.net/~martin/webrevs/jdk/Sensor-init/
https://bugs.openjdk.java.net/browse/JDK-8201327