why AtomicInteger in LinkedBlockingQueue always use getAndIncrement?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

why AtomicInteger in LinkedBlockingQueue always use getAndIncrement?

JSR166 Concurrency mailing list
why AtomicInteger in LinkedBlockingQueue always use getAndIncrement?why not IncrementAndGet.(PS:JDK8)

there is a reason or not? or both functions can be uesd.

I hope this question is not silly.



_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: why AtomicInteger in LinkedBlockingQueue always use getAndIncrement?

JSR166 Concurrency mailing list
Your suggestion may be a small improvement.

On Mon, Jul 27, 2020 at 6:01 PM Liu via Concurrency-interest
<[hidden email]> wrote:

>
> why AtomicInteger in LinkedBlockingQueue always use getAndIncrement?why not IncrementAndGet.(PS:JDK8)
>
> there is a reason or not? or both functions can be uesd.
>
> I hope this question is not silly.
>
>
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest