--- jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2004/12/28 16:15:59 1.9 +++ jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2005/05/25 14:27:37 1.10 @@ -78,8 +78,26 @@ public class AtomicReferenceFieldUpdater assertEquals(two,a.get(this)); a.set(this,m3); assertEquals(m3,a.get(this)); - } + + /** + * get returns the last value lazySet by same thread + */ + public void testGetLazySet(){ + AtomicReferenceFieldUpdatera; + try { + a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x"); + } catch (RuntimeException ok) { + return; + } + x = one; + assertEquals(one,a.get(this)); + a.lazySet(this,two); + assertEquals(two,a.get(this)); + a.lazySet(this,m3); + assertEquals(m3,a.get(this)); + } + /** * compareAndSet succeeds in changing value if equal to expected else fails */