Need to ensure that we don't claim that the communicator is gone until

after both the reader and writer have exited (otherwise the reader could
exit before the writer which would result in the client chucking its
reference to the communicator which could subsequently bite us in the ass
if anyone tried to reference the client's distributed object manager when
the writer finally exited and triggered all of the clientDidLogoff
callbacks). Multithreaded programming is fun!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1396 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-05-27 01:37:07 +00:00
parent 0ce79473fb
commit f0d7b8642b
@@ -1,5 +1,5 @@
//
// $Id: Communicator.java,v 1.18 2002/05/15 23:54:34 mdb Exp $
// $Id: Communicator.java,v 1.19 2002/05/27 01:37:07 mdb Exp $
package com.threerings.presents.client;
@@ -200,7 +200,9 @@ public class Communicator
_reader = null;
// let the client know when we finally go away
_client.communicatorDidExit();
if (_writer == null) {
_client.communicatorDidExit();
}
Log.debug("Reader thread exited.");
}
@@ -226,6 +228,11 @@ public class Communicator
// let the client observers know that we're logged off
_client.notifyObservers(Client.CLIENT_DID_LOGOFF, null);
// let the client know when we finally go away
if (_reader == null) {
_client.communicatorDidExit();
}
}
/**