Other entities may also want to queue up a shutdown.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3015 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: PresentsServer.java,v 1.39 2004/02/25 14:45:16 mdb Exp $
|
// $Id: PresentsServer.java,v 1.40 2004/06/03 09:03:06 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.presents.server;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
@@ -151,11 +151,7 @@ public class PresentsServer
|
|||||||
public boolean signalReceived (int signo)
|
public boolean signalReceived (int signo)
|
||||||
{
|
{
|
||||||
// this is called when we receive a ctrl-c
|
// this is called when we receive a ctrl-c
|
||||||
omgr.postUnit(new Runnable() {
|
queueShutdown();
|
||||||
public void run () {
|
|
||||||
shutdown();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,6 +253,19 @@ public class PresentsServer
|
|||||||
invoker.shutdown();
|
invoker.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Queues up a request to shutdown on the dobjmgr thread. This method
|
||||||
|
* may be safely called from any thread.
|
||||||
|
*/
|
||||||
|
public void queueShutdown ()
|
||||||
|
{
|
||||||
|
omgr.postUnit(new Runnable() {
|
||||||
|
public void run () {
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an entity that will be notified when the server is
|
* Registers an entity that will be notified when the server is
|
||||||
* shutting down.
|
* shutting down.
|
||||||
|
|||||||
Reference in New Issue
Block a user