1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
import java.util.concurrent.atomic.*; |
9 |
|
import junit.framework.*; |
10 |
< |
import java.util.*; |
10 |
> |
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; |
11 |
|
|
12 |
|
public class AtomicReferenceFieldUpdaterTest extends JSR166TestCase { |
13 |
|
volatile Integer x = null; |
33 |
|
} catch (RuntimeException success) {} |
34 |
|
} |
35 |
|
|
37 |
– |
|
36 |
|
/** |
37 |
|
* construction with field not of given type throws RuntimeException |
38 |
|
*/ |
58 |
|
} |
59 |
|
|
60 |
|
/** |
61 |
< |
* get returns the last value set or assigned |
61 |
> |
* get returns the last value set or assigned |
62 |
|
*/ |
63 |
|
public void testGetSet() { |
64 |
|
AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a; |
76 |
|
} |
77 |
|
|
78 |
|
/** |
79 |
< |
* get returns the last value lazySet by same thread |
79 |
> |
* get returns the last value lazySet by same thread |
80 |
|
*/ |
81 |
|
public void testGetLazySet() { |
82 |
|
AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a; |