public class ForkExample
extends java.lang.Object
Constructor and Description |
---|
ForkExample() |
Modifier and Type | Method and Description |
---|---|
boolean |
owned(PhilosopherExample asker)
Is the fork owned by the asker
|
void |
release(PhilosopherExample asker)
The philosopher asker releases the fork
|
boolean |
tryTake(PhilosopherExample asker)
The philosopher asker tries to take the fork
|
public boolean tryTake(PhilosopherExample asker)
asker
- The philosopher who triespublic void release(PhilosopherExample asker)
asker
- The philosopher who triespublic boolean owned(PhilosopherExample asker)
asker
- a philosopher