MCPcopy Create free account
hub / github.com/ReadyTalk/avian / run

Method run

test/ConcurrentHashMapTest.java:26–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 final int index = i;
25 new Thread() {
26 public void run() {
27 try {
28 synchronized (map) {
29 ++ counter[0];
30 map.notifyAll();
31 while (exception[0] == null && step[0] == 0) {
32 map.wait();
33 }
34 }
35
36 for (int i = 0; i < IterationCount; ++i) {
37 populateCommon(map);
38 populate(map, index * Range);
39 }
40
41 synchronized (map) {
42 -- counter[0];
43 map.notifyAll();
44 while (exception[0] == null && step[0] == 1) {
45 map.wait();
46 }
47 }
48
49 for (int i = 0; i < IterationCount; ++i) {
50 populate(map, index * Range);
51 depopulate(map, index * Range);
52 }
53
54 synchronized (map) {
55 ++ counter[0];
56 map.notifyAll();
57 }
58 } catch (Throwable e) {
59 synchronized (map) {
60 exception[0] = e;
61 map.notifyAll();
62 }
63 e.printStackTrace();
64 }
65 }
66 }.start();
67 }
68

Callers

nothing calls this directly

Calls 6

populateCommonMethod · 0.95
populateMethod · 0.95
depopulateMethod · 0.95
printStackTraceMethod · 0.80
notifyAllMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected