Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
4ban committed Nov 29, 2018
1 parent c892b41 commit 44977c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/ui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public JFrame createAndShowGui(boolean tournament) {

if (game.getGameState().isTurnament()) {
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

// no matter how many thread you have, it will block it till you finish with the previous
Thread t = new Thread() {
public void run() {
synchronized (lock) {
Expand All @@ -139,6 +139,7 @@ public void run() {
public void windowClosing(WindowEvent arg0) {
synchronized (lock) {
frame.setVisible(false);
// free thread when you finish with previous
lock.notify();
}
}
Expand Down

0 comments on commit 44977c6

Please sign in to comment.