Examples of lazySet()


Examples of java.util.concurrent.atomic.AtomicBoolean.lazySet()

    }

    @Test
    public void lazySet() throws Exception {
        AtomicBoolean value = new AtomicBoolean();
        value.lazySet(true);
        assert value.get();
    }

    @Test
    public void getAndSet() throws Exception {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.lazySet()

    }

    @Test
    public void lazySet() throws Exception {
        AtomicInteger value = new AtomicInteger();
        value.lazySet(20);
        assert value.get() == 20;
    }

    @Test
    public void getAndSet() throws Exception {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

    AtomicIntegerArray a1 = new AtomicIntegerArray(ARRLEN);
    AtomicIntegerArray a2 = new AtomicIntegerArray(ARRLEN);
    // Initialize
    for (int i=0; i<ARRLEN; i++) {
      a1.lazySet(i, -1);
      a2.lazySet(i, -1);
    }
    System.out.println("Warmup");
    for (int i=0; i<ITERS; i++) {
      test_ci(a1);
      test_vi(a2, 123, -1);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

      test_2vi_unaln(a1, a2, 123, 103);
    }
    // Initialize
    for (int i=0; i<ARRLEN; i++) {
      a1.lazySet(i, -1);
      a2.lazySet(i, -1);
    }
    // Test and verify results
    System.out.println("Verification");
    int errn = 0;
    {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        errn += verify("test_2vi: a2", i, a2.get(i), 103);
      }
      // Reset for negative stride
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_neg(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_ci_neg: a1", i, a1.get(i), -123);
      }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        errn += verify("test_2vi_neg: a2", i, a2.get(i), 103);
      }
      // Reset for opposite stride
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_oppos(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_ci_oppos: a1", i, a1.get(i), -123);
      }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        errn += verify("test_2vi_oppos: a2", i, a2.get(i), 103);
      }
      // Reset for indexing with offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_off(a1, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_ci_off: a1", i, a1.get(i), -123);
      }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        errn += verify("test_2vi_off: a2", i, a2.get(i), -1);
      }
      // Reset for indexing with invariant offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_inv(a1, OFFSET, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_ci_inv: a1", i, a1.get(i), -123);
      }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        errn += verify("test_2vi_inv: a2", i, a2.get(i), -1);
      }
      // Reset for indexing with scale
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_scl(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        int val = (i%SCALE != 0) ? -1 : -123;
        errn += verify("test_ci_scl: a1", i, a1.get(i), val);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray.lazySet()

        }
      }
      // Reset for 2 arrays with relative aligned offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_vi(a2, 123, -1);
      test_cp_alndst(a1, a2);
      for (int i=0; i<ALIGN_OFF; i++) {
        errn += verify("test_cp_alndst: a1", i, a1.get(i), -1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.