Re: JavaMemoryModel: subtle details for final fields

From: Bill Pugh (pugh@cs.umd.edu)
Date: Wed Aug 29 2001 - 15:29:18 EDT


At 12:22 PM -0700 8/29/01, Ross Knippel wrote:
>Typo in assert in t2?

> > static void T2() {
>> A a = global;
>> synchronized (A.class) {
>> if (a == null) return;
>> int r1 = a.x;
>> // possible r1 != 42; // might not see final value
>> a = global; // reload global at a point definitely after construction
>> int r2 = a.x;
>> assert r1 == 42; <----------- typo ?
> ^^
> r2
> > }
> > }
> > }

Yes, thank you.

        Bill
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:34 EDT