hg: lambda/lambda/jdk: Summary: add ThreadLocal(Factory<T>) and compareAndSet methods
Aleksey Shipilev
aleksey.shipilev at oracle.com
Tue Jul 31 03:35:26 PDT 2012
Thanks Jim!
Please make sure you have both versions in place (i.e.
updateAndGet/getAndUpdate). Also, while you are at it, can you also add
the updaters for AtomicReference and friends?
-Aleksey.
On 07/30/2012 07:23 PM, Jim Gish wrote:
> That's it Mike -- pass the buck :-) If we're agreed on the names, I'll
> be happy to change them. Any other comments before I do that?
>
> Thanks,
> Jim
>
> On 07/30/2012 11:07 AM, Mike Duigou wrote:
>> I like your name suggestions. I too was uncomfortable with the
>> "compare" naming but didn't have good suggestions. At this point the
>> naming is definitely not final but only exploratory.
>>
>> This work was done by Jim Gish, a new OpenJDK contributor. I am only
>> responsible for helping with a pre-commit review and pushing the
>> change to the repo.
>>
>> Mike
>>
>>
>> On Jul 30 2012, at 04:16 , Aleksey Shipilev wrote:
>>
>>> I think these method names are bad:
>>> int compareAndSet(IntUnaryOperator op);
>>>
>>> Admittedly, these are not the CAS-family operations. Compare with what?
>>> Set to what? Is this method one-shot, or it runs until successful
>>> (method name implies it is one-shot, but JavaDoc says otherwise)?
>>>
>>> I think then names should be coherent with other high-level methods,
>>> like incrementAndGet, etc., i.e.:
>>> int updateAndGet(IntUnaryOperator updater);
>>> int getAndUpdate(IntUnaryOperator updater);
>>>
>>> -Aleksey.
>>>
>>> On 07/27/2012 11:29 PM, mike.duigou at oracle.com wrote:
>>>> Changeset: 2fd2a7092fe1
>>>> Author: jgish
>>>> Date: 2012-07-27 15:04 -0400
>>>> URL:
>>>> http://hg.openjdk.java.net/lambda/lambda/jdk/rev/2fd2a7092fe1
>>>>
>>>> Summary: add ThreadLocal(Factory<T>) and compareAndSet methods
>>>> Reviewed-by: briangoetz,smarks,mduigo
>>>> Contributed-by: Jim Gish <jim.gish at oracle.com>
>>>>
>>>> ! make/java/java/FILES_java.gmk
>>>> ! src/share/classes/java/lang/ThreadLocal.java
>>>> ! src/share/classes/java/util/concurrent/atomic/AtomicInteger.java
>>>> ! src/share/classes/java/util/concurrent/atomic/AtomicLong.java
>>>> + src/share/classes/java/util/functions/DoubleUnaryOperator.java
>>>> + src/share/classes/java/util/functions/IntUnaryOperator.java
>>>> + src/share/classes/java/util/functions/LongUnaryOperator.java
>>>> + src/share/classes/java/util/functions/UnaryOperator.java
>>>> + test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalFactoryTest.java
>>>> + test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalTest.java
>>>> +
>>>> test-ng/tests/org/openjdk/tests/java/util/functions/DoubleUnaryOperatorTest.java
>>>>
>>>> +
>>>> test-ng/tests/org/openjdk/tests/java/util/functions/IntUnaryOperatorTest.java
>>>>
>>>> +
>>>> test-ng/tests/org/openjdk/tests/java/util/functions/LongUnaryOperatorTest.java
>>>>
>>>> +
>>>> test-ng/tests/org/openjdk/tests/java/util/functions/UnaryOperatorTest.java
>>>>
>>>> ! test/java/lang/ThreadLocal/Basic.java
>>>> ! test/java/lang/ThreadLocal/ImmutableLocal.java
>>>> ! test/java/lang/ThreadLocal/InitialValue.java
>>>> ! test/java/lang/ThreadLocal/TLRemoveTest.java
>>>> ! test/java/lang/ThreadLocal/TestThreadId.java
>>>>
>>>>
>>
>
More information about the lambda-dev
mailing list