MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / g

Method g

lowlevel/SyncOnObject.java:21–28  ·  view source on GitHub ↗
(boolean nap)

Source from the content-addressed store, hash-verified

19 }
20 private Object syncObject = new Object();
21 public void g(boolean nap) {
22 synchronized(syncObject) {
23 for(int i = 0; i < 5; i++) {
24 trace.add(String.format("g() " + i));
25 if(nap) new Nap(0.01);
26 }
27 }
28 }
29}
30
31public class SyncOnObject {

Callers 1

testMethod · 0.95

Calls 2

addMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected