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.AtomicIntegerFieldUpdater; |
11 |
|
|
12 |
|
public class AtomicIntegerFieldUpdaterTest extends JSR166TestCase { |
13 |
|
volatile int x = 0; |
112 |
|
assertEquals(7,a.get(this)); |
113 |
|
} |
114 |
|
|
116 |
– |
|
115 |
|
/** |
116 |
|
* compareAndSet in one thread enables another waiting for value |
117 |
|
* to succeed |