Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Question whether a problem with race conditions exists in this case Date: Wed, 14 Dec 2011 17:44:13 -0500 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: <8bbbbee3-adcc-4f28-aff5-2e230b047401@u6g2000vbg.googlegroups.com> <31419376.376.1323889493017.JavaMail.geo-discussion-forums@prmw6> <1e0613c1-9248-4f1d-a5e1-65f08aa31c0f@y18g2000yqy.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 14 Dec 2011 22:44:17 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="HSlJAUb3pGXi3i7ZL/HoAw"; logging-data="30164"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QjgQUj5SU+E4ryTQ2uEJ6" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Cancel-Lock: sha1:23ynu+Fw4acBfanPQxIUHEyx6iQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10754 On 12/14/2011 5:13 PM, markspace wrote: > On 12/14/2011 12:32 PM, Saxo wrote: > >> This way the single AtomicBoolean object is passed that will be >> changed from false to true by reference, so that all new values >> become visible for any thread calling aNode.get() "at once". >> > > But there isn't a single AtomicBoolean, and it isn't passed in. It's > assigned as an instance variable initialization. There's one > AtomicBoolean per Node object. The instance field gets changed in the setNewValue() call. The original value is only there, as far as I can see, to cough up a "false" until it's replaced. I still wish I knew what he's trying to do, though. -- Eric Sosman esosman@ieee-dot-org.invalid