下面列出了java.util.concurrent.atomic.AtomicIntegerArray#getAndSet() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
static void test_2ci_aln(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.compareAndSet((i+ALIGN_OFF), -1, -123);
b.getAndSet(i, -103);
}
}
static void test_cp_alnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+ALIGN_OFF));
}
}
static void test_2vi_aln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+ALIGN_OFF), d);
}
}
static void test_cp_unalnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+UNALIGN_OFF));
}
}
static void test_2ci_unaln(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.compareAndSet((i+UNALIGN_OFF), -1, -123);
b.getAndSet(i, -103);
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_cp_alnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+ALIGN_OFF));
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_2vi_aln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+ALIGN_OFF), d);
}
}
static void test_cp_alnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+ALIGN_OFF));
}
}
static void test_2ci_unaln(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.compareAndSet((i+UNALIGN_OFF), -1, -123);
b.getAndSet(i, -103);
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_2ci_aln(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.compareAndSet((i+ALIGN_OFF), -1, -123);
b.getAndSet(i, -103);
}
}
static void test_cp_alnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+ALIGN_OFF));
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_2vi_aln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+ALIGN_OFF), d);
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+UNALIGN_OFF), d);
}
}
static void test_2vi_aln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) {
for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) {
a.getAndSet(i, c);
b.getAndSet((i+ALIGN_OFF), d);
}
}
static void test_cp_unalnsrc(AtomicIntegerArray a, AtomicIntegerArray b) {
for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) {
a.getAndSet(i, b.get(i+UNALIGN_OFF));
}
}