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

Method pickUp

java/Chapter 16/Question16_3/Philosopher.java:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 }
28
29 public boolean pickUp() {
30 pause();
31 if (!left.pickUp()) {
32 return false;
33 }
34 pause();
35 if (!right.pickUp()) {
36 left.putDown();
37 return false;
38 }
39 pause();
40 return true;
41 }
42
43 public void chew() {
44 System.out.println("Philosopher " + index + ": eating");

Callers 1

eatMethod · 0.95

Calls 2

pauseMethod · 0.95
putDownMethod · 0.45

Tested by

no test coverage detected