From 21f144f963ac69a881efcf5d68e4648f22527c0f Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Wed, 22 Jun 2011 07:45:21 +0200 Subject: Fixed threading issue git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@583 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/network/ConnectionControl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3