MCPcopy Create free account
hub / github.com/careercup/ctci / bar

Method bar

java/Chapter 16/IntroductionSynchronization/MyObject.java:14–22  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

12 }
13
14 public static synchronized void bar(String name) {
15 try {
16 System.out.println("Thread " + name + ".bar(): starting");
17 Thread.sleep(3000);
18 System.out.println("Thread " + name + ".bar(): ending");
19 } catch (InterruptedException exc) {
20 System.out.println("Thread " + name + ": interrupted.");
21 }
22 }
23}

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected