2014-02-20, 10:08 PM
So the loop solution is...
?
At the moment, when I run the code, nothing happens after the threads are started. Both are waiting to be woken up. What wakes them up, I don't know.
I can't call notify or notifyAll from main, which means:
Code:
while((!player1.hasWon) && (!player2.hasWon)){
}?
none of the threads are asleep
At the moment, when I run the code, nothing happens after the threads are started. Both are waiting to be woken up. What wakes them up, I don't know.
I can't call notify or notifyAll from main, which means:
- Dealer should be a thread and somehow notify player1 when it's done dealing?
- notify should happen somewhere in the Player thread?
- go() shouldn't wait and instead, the draw() and discard() methods in CardDeck should be synchronized instead?

