Re: Javadoc for ConcurrentSkipListMap.computeIfAbsent()
Alex Otenko via Concurrency-interest <[email protected]>
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CANkgWKhd_k4eN_MLUrut-xtn_wvigpPsEf5POQO+-90TRxyDcQ@mail.gmail.com> |
Define "present" / "not present". In a concurrent setting the boolean outcome of the function does not imply anything about how it decided that. In particular, was it seen "not present", but lost the race to set the new value. Alex On Mon, 24 Feb 2020, 04:57 Roman Leventov via Concurrency-interest, < [email protected]> wrote: > It says: "The function is NOT guaranteed to be applied once atomically > only if the value is not present." > > It's hard to parse this sentence, and it seems to me to make little > sense since when the value is present, the function is not applied at all. > IMO it would be better to remove the last part "only if the value is not > present", making it equal to the corresponding sentence in compute() and > computeIfPresent() Javadocs. > _______________________________________________ > Concurrency-interest mailing list > [email protected] > http://cs.oswego.edu/mailman/listinfo/concurrency-interest > _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest