summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/IncomingConnectionFactory.java
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-05-31 00:08:10 +0000
committerMarc Laukien <marc@zeroc.com>2002-05-31 00:08:10 +0000
commitf59d63d73f52dc2dad7390b43f964196e369df92 (patch)
tree6e5093e7d628f52ba0ec5061b611930508a5d74f /java/src/IceInternal/IncomingConnectionFactory.java
parentglacier batching fixes (diff)
downloadice-f59d63d73f52dc2dad7390b43f964196e369df92.tar.bz2
ice-f59d63d73f52dc2dad7390b43f964196e369df92.tar.xz
ice-f59d63d73f52dc2dad7390b43f964196e369df92.zip
fixed thread pool registration bug
Diffstat (limited to 'java/src/IceInternal/IncomingConnectionFactory.java')
-rw-r--r--java/src/IceInternal/IncomingConnectionFactory.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/java/src/IceInternal/IncomingConnectionFactory.java b/java/src/IceInternal/IncomingConnectionFactory.java
index 061e1c90b82..82862a9f79c 100644
--- a/java/src/IceInternal/IncomingConnectionFactory.java
+++ b/java/src/IceInternal/IncomingConnectionFactory.java
@@ -199,8 +199,7 @@ public class IncomingConnectionFactory extends EventHandler
*/
public
- IncomingConnectionFactory(Instance instance, Endpoint endpoint,
- Ice.ObjectAdapter adapter)
+ IncomingConnectionFactory(Instance instance, Endpoint endpoint, Ice.ObjectAdapter adapter)
{
super(instance);
_endpoint = endpoint;
@@ -213,6 +212,7 @@ public class IncomingConnectionFactory extends EventHandler
_state = StateHolding;
_warn = _instance.properties().getPropertyAsInt("Ice.ConnectionWarnings") > 0 ? true : false;
_finished = false;
+ _registeredWithPool = false;
try
{
@@ -358,12 +358,16 @@ public class IncomingConnectionFactory extends EventHandler
{
if (_acceptor != null)
{
- if (_serverThreadPool == null)
- {
- _serverThreadPool = _instance.serverThreadPool();
- assert(_serverThreadPool != null);
- }
- _serverThreadPool._register(_acceptor.fd(), this);
+ if (!_registeredWithPool)
+ {
+ if (_serverThreadPool == null)
+ {
+ _serverThreadPool = _instance.serverThreadPool();
+ assert(_serverThreadPool != null);
+ }
+ _serverThreadPool._register(_acceptor.fd(), this);
+ _registeredWithPool = true;
+ }
}
}
@@ -372,8 +376,12 @@ public class IncomingConnectionFactory extends EventHandler
{
if (_acceptor != null)
{
- assert(_serverThreadPool != null);
- _serverThreadPool.unregister(_acceptor.fd());
+ if (!_registeredWithPool)
+ {
+ assert(_serverThreadPool != null);
+ _serverThreadPool.unregister(_acceptor.fd());
+ _registeredWithPool = true;
+ }
}
}
@@ -397,4 +405,5 @@ public class IncomingConnectionFactory extends EventHandler
private int _state;
private boolean _warn;
private boolean _finished;
+ private boolean _registeredWithPool;
}