58 if (t.f_int != i) {
59 throw new RuntimeException("bad result!");
60 }
61 }
62 Integer minusOne = Integer.valueOf(-1);
63 for (int i = 0; i < 100_000; i++) {
64 t.f_obj = minusOne;
65 t.testObj(minusOne, Integer.valueOf(i));
66 if (t.f_obj != i) {
67 throw new RuntimeException("bad result!");
68 }
69 }
70 }
71 public void testInt(int x, int i)
72 {
73 unsafe.compareAndSetInt(this, f_int_off, x, i);
74 }
75
76 public void testObj(Object x, Object o)
77 {
78 unsafe.compareAndSetObject(this, f_obj_off, x, o);
79 }
80 }
|
58 if (t.f_int != i) {
59 throw new RuntimeException("bad result!");
60 }
61 }
62 Integer minusOne = Integer.valueOf(-1);
63 for (int i = 0; i < 100_000; i++) {
64 t.f_obj = minusOne;
65 t.testObj(minusOne, Integer.valueOf(i));
66 if (t.f_obj != i) {
67 throw new RuntimeException("bad result!");
68 }
69 }
70 }
71 public void testInt(int x, int i)
72 {
73 unsafe.compareAndSetInt(this, f_int_off, x, i);
74 }
75
76 public void testObj(Object x, Object o)
77 {
78 unsafe.compareAndSetReference(this, f_obj_off, x, o);
79 }
80 }
|