summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/IncomingConnectionFactory.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-04-16 23:02:05 +0000
committerMark Spruiell <mes@zeroc.com>2002-04-16 23:02:05 +0000
commitf735a39d64deba47b416e41442d1321f9c972d8c (patch)
tree12a7b8ed7c594f13ee511cec9e409669e7ad90fd /java/src/IceInternal/IncomingConnectionFactory.java
parentWin32 fixes for IceBox (diff)
downloadice-f735a39d64deba47b416e41442d1321f9c972d8c.tar.bz2
ice-f735a39d64deba47b416e41442d1321f9c972d8c.tar.xz
ice-f735a39d64deba47b416e41442d1321f9c972d8c.zip
align with C++ - fixes for the thread pool
Diffstat (limited to 'java/src/IceInternal/IncomingConnectionFactory.java')
-rw-r--r--java/src/IceInternal/IncomingConnectionFactory.java60
1 files changed, 32 insertions, 28 deletions
diff --git a/java/src/IceInternal/IncomingConnectionFactory.java b/java/src/IceInternal/IncomingConnectionFactory.java
index 57d03cd283b..d6f8b57d37d 100644
--- a/java/src/IceInternal/IncomingConnectionFactory.java
+++ b/java/src/IceInternal/IncomingConnectionFactory.java
@@ -155,40 +155,44 @@ public class IncomingConnectionFactory extends EventHandler
public synchronized void
finished()
{
- _threadPool.promoteFollower();
+ assert(_state == StateClosed || _state == StateHolding);
- assert(_state == StateClosed);
- assert(_connections.isEmpty());
+ _threadPool.promoteFollower();
- try
+ if (_state == StateClosed)
{
- //
- // Clear listen() backlog properly by accepting all queued
- // connections, and then shutting them down.
- //
- while (true)
+ assert(_connections.isEmpty());
+
+ try
{
- try
+ //
+ // Clear listen() backlog properly by accepting all queued
+ // connections, and then shutting them down.
+ //
+ while (true)
{
- Transceiver transceiver = _acceptor.accept(0);
- Connection connection = new Connection(_instance, transceiver, _endpoint, _adapter);
- connection.exception(new Ice.ObjectAdapterDeactivatedException());
- }
- catch (Ice.TimeoutException ex)
- {
- break; // Exit loop on timeout.
+ try
+ {
+ Transceiver transceiver = _acceptor.accept(0);
+ Connection connection = new Connection(_instance, transceiver, _endpoint, _adapter);
+ connection.exception(new Ice.ObjectAdapterDeactivatedException());
+ }
+ catch (Ice.TimeoutException ex)
+ {
+ break; // Exit loop on timeout.
+ }
}
}
- }
- catch (Ice.LocalException ex)
- {
- if (_warn)
+ catch (Ice.LocalException ex)
{
- warning(ex);
+ if (_warn)
+ {
+ warning(ex);
+ }
}
- }
- _acceptor.close();
+ _acceptor.close();
+ }
}
public void
@@ -307,14 +311,14 @@ public class IncomingConnectionFactory extends EventHandler
case StateHolding:
{
- if (_state != StateActive) // Can only switch from active to
- { // holding
+ if (_state != StateActive) // Can only switch from active to holding
+ {
return;
}
if (_threadPool != null)
{
- _threadPool.unregister(_acceptor.fd(), false);
+ _threadPool.unregister(_acceptor.fd());
}
java.util.ListIterator iter = _connections.listIterator();
@@ -338,7 +342,7 @@ public class IncomingConnectionFactory extends EventHandler
{
_threadPool._register(_acceptor.fd(), this);
}
- _threadPool.unregister(_acceptor.fd(), true);
+ _threadPool.unregister(_acceptor.fd());
}
java.util.ListIterator iter = _connections.listIterator();