Changed Task Philosopher
This commit is contained in:
parent
b5fc96ef94
commit
7dfa09a53e
|
@ -46,7 +46,7 @@ class ForkManager {
|
|||
Fork rightFork = rightFork(philosopherId);
|
||||
// acquire forks sequentially
|
||||
while(!(leftFork.getState() == FREE && rightFork.getState() == FREE)){
|
||||
forkDelay();
|
||||
forkDelay(); //wait if not both forks are available
|
||||
}
|
||||
leftFork.acquire(philosopherId);
|
||||
forkDelay();
|
||||
|
|
Loading…
Reference in New Issue