summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/network
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-22 07:45:21 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-22 07:45:21 +0200
commit21f144f963ac69a881efcf5d68e4648f22527c0f (patch)
tree5e9c817963c35ca2bd2cf9a39d8dfa51b48647e4 /src/jrummikub/control/network
parent936a22ff772b0b1561ad0611c8a7ff3566e01dca (diff)
downloadJRummikub-21f144f963ac69a881efcf5d68e4648f22527c0f.tar
JRummikub-21f144f963ac69a881efcf5d68e4648f22527c0f.zip
Fixed threading issue
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@583 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/network')
-rw-r--r--src/jrummikub/control/network/ConnectionControl.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/jrummikub/control/network/ConnectionControl.java b/src/jrummikub/control/network/ConnectionControl.java
index 0de8776..b5e3ac5 100644
--- a/src/jrummikub/control/network/ConnectionControl.java
+++ b/src/jrummikub/control/network/ConnectionControl.java
@@ -815,16 +815,21 @@ public class ConnectionControl implements IConnectionControl {
}
private abstract class SendRunner implements Runnable {
+ Message message;
+
+ public SendRunner() {
+ DefaultPacketExtension extension = createJRummikubExtension();
+ addData(extension);
+ message = createMessage(extension);
+ modifyMessage(message);
+ }
+
@Override
public void run() {
// For thread safety
Connection theConnection = connection;
if (theConnection != null) {
- DefaultPacketExtension extension = createJRummikubExtension();
- addData(extension);
- Message message = createMessage(extension);
- modifyMessage(message);
theConnection.sendPacket(message);
}
}