Java Code Examples for java.util.concurrent.atomic.AtomicIntegerArray#set()
The following examples show how to use
java.util.concurrent.atomic.AtomicIntegerArray#set() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestIntAtomicVolatile.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
static void test_2vi_oppos(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) { int limit = ARRLEN-1; for (int i = limit; i >= 0; i-=1) { a.set(i, c); b.set((limit-i), d); } }
Example 2
Source File: AtomicIntegerArrayTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * incrementAndGet increments and returns current value */ public void testIncrementAndGet() { AtomicIntegerArray aa = new AtomicIntegerArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(2, aa.incrementAndGet(i)); assertEquals(2, aa.get(i)); aa.set(i, -2); assertEquals(-1, aa.incrementAndGet(i)); assertEquals(0, aa.incrementAndGet(i)); assertEquals(1, aa.incrementAndGet(i)); assertEquals(1, aa.get(i)); } }
Example 3
Source File: AtomicIntegerArrayTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * decrementAndGet decrements and returns current value */ public void testDecrementAndGet() { AtomicIntegerArray aa = new AtomicIntegerArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(0, aa.decrementAndGet(i)); assertEquals(-1, aa.decrementAndGet(i)); assertEquals(-2, aa.decrementAndGet(i)); assertEquals(-2, aa.get(i)); } }
Example 4
Source File: TestIntAtomicVolatile.java From hottub with GNU General Public License v2.0 | 4 votes |
static void test_2vi_scl(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { a.set((i*SCALE), c); b.set((i*SCALE), d); } }
Example 5
Source File: TestIntAtomicVolatile.java From hottub with GNU General Public License v2.0 | 4 votes |
static void test_vi_oppos(AtomicIntegerArray a, int b, int old) { int limit = ARRLEN-1; for (int i = limit; i >= 0; i-=1) { a.set((limit-i), b); } }
Example 6
Source File: TestIntAtomicVolatile.java From hottub with GNU General Public License v2.0 | 4 votes |
static void test_2ci_aln(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { a.set((i+ALIGN_OFF), -123); b.set(i, -103); } }
Example 7
Source File: TestIntAtomicVolatile.java From hottub with GNU General Public License v2.0 | 4 votes |
static void test_2vi_unaln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { a.set(i, c); b.set((i+UNALIGN_OFF), d); } }
Example 8
Source File: TestIntAtomicVolatile.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
static void test_cp_neg(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = ARRLEN-1; i >= 0; i-=1) { a.set(i, b.get(i)); } }
Example 9
Source File: TestIntAtomicVolatile.java From hottub with GNU General Public License v2.0 | 4 votes |
static void test_2vi_aln(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { a.set(i, c); b.set((i+ALIGN_OFF), d); } }
Example 10
Source File: TestIntAtomicVolatile.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
static void test_2ci_aln(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { a.set((i+ALIGN_OFF), -123); b.set(i, -103); } }
Example 11
Source File: TestIntAtomicVolatile.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
static void test_vi_oppos(AtomicIntegerArray a, int b, int old) { int limit = ARRLEN-1; for (int i = limit; i >= 0; i-=1) { a.set((limit-i), b); } }
Example 12
Source File: TestIntAtomicVolatile.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static void test_cp_alndst(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { a.set((i+ALIGN_OFF), b.get(i)); } }
Example 13
Source File: TestIntAtomicVolatile.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
static void test_2ci_unaln(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { a.set((i+UNALIGN_OFF), -123); b.set(i, -103); } }
Example 14
Source File: TestIntAtomicVolatile.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
static void test_cp_neg(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = ARRLEN-1; i >= 0; i-=1) { a.set(i, b.get(i)); } }
Example 15
Source File: TestIntAtomicVolatile.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static void test_2ci_inv(AtomicIntegerArray a, AtomicIntegerArray b, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { a.set((i+k), -123); b.set((i+k), -103); } }
Example 16
Source File: TestIntAtomicVolatile.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
static void test_cp_off(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { a.set((i+OFFSET), b.get(i+OFFSET)); } }
Example 17
Source File: TestIntAtomicVolatile.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
static void test_2vi_inv(AtomicIntegerArray a, AtomicIntegerArray b, int c, int d, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { a.set((i+k), c); b.set((i+k), d); } }
Example 18
Source File: TestIntAtomicVolatile.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static void test_2ci_off(AtomicIntegerArray a, AtomicIntegerArray b) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { a.set((i+OFFSET), -123); b.set((i+OFFSET), -103); } }
Example 19
Source File: TestIntAtomicVolatile.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
static void test_cp_inv(AtomicIntegerArray a, AtomicIntegerArray b, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { a.set((i+k), b.get(i+k)); } }
Example 20
Source File: TestIntAtomicVolatile.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static void test_ci_scl(AtomicIntegerArray a, int old) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { a.set((i*SCALE), -123); } }