summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-03 18:00:24 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-03 18:00:24 -0500
commitce6ae1b56e4f6548dc19974474c8ee2d8cece13a (patch)
tree841a308e44cd0441ec86c07189d3a451b286962a /src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java
parentc791c138d4d73b495c8a355ae01bca754e1ce66b (diff)
downloadfourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.tar.gz
fourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.tar.bz2
fourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.zip
Fixed [Gotez06] InterruptedException violation
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java index 2395dd0..d129303 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java
@@ -11,8 +11,6 @@ import com.fourisland.fourpuzzle.gamestate.mapview.event.LayerEvent;
11import java.util.List; 11import java.util.List;
12import java.util.Vector; 12import java.util.Vector;
13import java.util.concurrent.Semaphore; 13import java.util.concurrent.Semaphore;
14import java.util.logging.Level;
15import java.util.logging.Logger;
16 14
17/** 15/**
18 * 16 *
@@ -37,7 +35,7 @@ public class MoveEventThread implements Runnable {
37 try { 35 try {
38 moveEventWait.acquire(); 36 moveEventWait.acquire();
39 } catch (InterruptedException ex) { 37 } catch (InterruptedException ex) {
40 Logger.getLogger(MoveEventThread.class.getName()).log(Level.SEVERE, null, ex); 38 Thread.currentThread().interrupt();
41 } 39 }
42 40
43 while (ev.isMoving()) 41 while (ev.isMoving())
@@ -45,7 +43,7 @@ public class MoveEventThread implements Runnable {
45 try { 43 try {
46 Thread.sleep(2); 44 Thread.sleep(2);
47 } catch (InterruptedException ex) { 45 } catch (InterruptedException ex) {
48 Logger.getLogger(MoveEventThread.class.getName()).log(Level.SEVERE, null, ex); 46 Thread.currentThread().interrupt();
49 } 47 }
50 } 48 }
51 49
@@ -74,14 +72,10 @@ public class MoveEventThread implements Runnable {
74 return (events.contains(event)); 72 return (events.contains(event));
75 } 73 }
76 74
77 public static void moveAll() 75 public static void moveAll() throws InterruptedException
78 { 76 {
79 try { 77 moveEventWait.acquire(100);
80 moveEventWait.acquire(100); 78 moveEventWait.release(100);
81 moveEventWait.release(100);
82 } catch (InterruptedException ex) {
83 Logger.getLogger(MoveEventThread.class.getName()).log(Level.SEVERE, null, ex);
84 }
85 } 79 }
86 80
87} 81}