From ae4267a7d5dc82ece742fc4ea7cc24596dd0b7df Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 10 Jul 2002 01:25:11 +0000 Subject: [PATCH] Fixed problem with LogoffDispatcher where it was reusing a single instance for all clients in a non-reentrant manner. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1566 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/server/PresentsClient.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/java/com/threerings/presents/server/PresentsClient.java b/src/java/com/threerings/presents/server/PresentsClient.java index 958230130..c3c9225d7 100644 --- a/src/java/com/threerings/presents/server/PresentsClient.java +++ b/src/java/com/threerings/presents/server/PresentsClient.java @@ -1,5 +1,5 @@ // -// $Id: PresentsClient.java,v 1.32 2002/05/31 07:33:33 mdb Exp $ +// $Id: PresentsClient.java,v 1.33 2002/07/10 01:25:11 mdb Exp $ package com.threerings.presents.server; @@ -571,26 +571,22 @@ public class PresentsClient /** * Processes logoff requests. */ - protected static class LogoffDispatcher - implements MessageDispatcher, Runnable + protected static class LogoffDispatcher implements MessageDispatcher { - public void dispatch (PresentsClient client, UpstreamMessage msg) + public void dispatch (final PresentsClient client, UpstreamMessage msg) { Log.info("Client requested logoff " + "[client=" + client + "]."); - _client = client; - // queue ourselves up to be run on the object manager thread - // where we can safely end the session - PresentsServer.omgr.postUnit(this); - } - public void run () - { - // end the session in a civilized manner - _client.endSession(); + // queue up a runnable on the object manager thread where we + // can safely end the session + PresentsServer.omgr.postUnit(new Runnable() { + public void run () { + // end the session in a civilized manner + client.endSession(); + } + }); } - - protected PresentsClient _client; } protected ClientManager _cmgr;