zeroc-ice 3.6.0 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/ice/cpp/include/Ice/BuiltinSequences.h +2 -2
- data/ext/ice/cpp/include/Ice/Communicator.h +2 -2
- data/ext/ice/cpp/include/Ice/CommunicatorF.h +2 -2
- data/ext/ice/cpp/include/Ice/Connection.h +5 -9
- data/ext/ice/cpp/include/Ice/ConnectionF.h +2 -2
- data/ext/ice/cpp/include/Ice/Current.h +2 -2
- data/ext/ice/cpp/include/Ice/Endpoint.h +6 -11
- data/ext/ice/cpp/include/Ice/EndpointF.h +2 -2
- data/ext/ice/cpp/include/Ice/EndpointTypes.h +2 -2
- data/ext/ice/cpp/include/Ice/FacetMap.h +2 -2
- data/ext/ice/cpp/include/Ice/Ice.h +1 -0
- data/ext/ice/cpp/include/Ice/Identity.h +2 -2
- data/ext/ice/cpp/include/Ice/ImplicitContext.h +2 -2
- data/ext/ice/cpp/include/Ice/ImplicitContextF.h +2 -2
- data/ext/ice/cpp/include/Ice/Instrumentation.h +2 -2
- data/ext/ice/cpp/include/Ice/InstrumentationF.h +2 -2
- data/ext/ice/cpp/include/Ice/LocalException.h +2 -2
- data/ext/ice/cpp/include/Ice/Locator.h +2 -2
- data/ext/ice/cpp/include/Ice/LocatorF.h +2 -2
- data/ext/ice/cpp/include/Ice/Logger.h +2 -2
- data/ext/ice/cpp/include/Ice/LoggerF.h +2 -2
- data/ext/ice/cpp/include/Ice/Metrics.h +7 -14
- data/ext/ice/cpp/include/Ice/ObjectAdapter.h +2 -2
- data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +2 -2
- data/ext/ice/cpp/include/Ice/ObjectFactory.h +2 -2
- data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +2 -2
- data/ext/ice/cpp/include/Ice/Plugin.h +2 -2
- data/ext/ice/cpp/include/Ice/PluginF.h +2 -2
- data/ext/ice/cpp/include/Ice/Process.h +2 -2
- data/ext/ice/cpp/include/Ice/ProcessF.h +2 -2
- data/ext/ice/cpp/include/Ice/Properties.h +2 -2
- data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +2 -2
- data/ext/ice/cpp/include/Ice/PropertiesF.h +2 -2
- data/ext/ice/cpp/include/Ice/RegisterPlugins.h +55 -0
- data/ext/ice/cpp/include/Ice/RemoteLogger.h +2 -2
- data/ext/ice/cpp/include/Ice/Router.h +2 -2
- data/ext/ice/cpp/include/Ice/RouterF.h +2 -2
- data/ext/ice/cpp/include/Ice/ServantLocator.h +2 -2
- data/ext/ice/cpp/include/Ice/ServantLocatorF.h +2 -2
- data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +2 -2
- data/ext/ice/cpp/include/Ice/Version.h +2 -2
- data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +4 -6
- data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +3 -5
- data/ext/ice/cpp/include/IceUtil/Config.h +5 -5
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Communicator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +0 -1
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +12 -17
- data/ext/ice/cpp/src/Ice/Connection.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +33 -4
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +8 -0
- data/ext/ice/cpp/src/Ice/Current.cpp +2 -2
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +0 -1
- data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +2 -0
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +2 -2
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +2 -2
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +2 -2
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +0 -2
- data/ext/ice/cpp/src/Ice/Identity.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Initialize.cpp +25 -30
- data/ext/ice/cpp/src/Ice/Instance.cpp +1 -3
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +2 -2
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LocalException.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Locator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +6 -6
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +9 -8
- data/ext/ice/cpp/src/Ice/Logger.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Metrics.cpp +10 -2
- data/ext/ice/cpp/src/Ice/Network.h +10 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +68 -143
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +1 -2
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Outgoing.cpp +0 -1
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +0 -1
- data/ext/ice/cpp/src/Ice/Plugin.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PluginF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Process.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Properties.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +6 -7
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +17 -18
- data/ext/ice/cpp/src/Ice/Reference.cpp +1 -1
- data/ext/ice/cpp/src/Ice/{RegisterPlugins.cpp → RegisterPluginsInit.cpp} +1 -1
- data/ext/ice/cpp/src/Ice/{RegisterPlugins.h → RegisterPluginsInit.h} +2 -2
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Router.cpp +2 -2
- data/ext/ice/cpp/src/Ice/RouterF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Selector.cpp +51 -45
- data/ext/ice/cpp/src/Ice/Selector.h +4 -4
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +2 -2
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +7 -2
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +15 -3
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +0 -2
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +46 -47
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +28 -8
- data/ext/ice/cpp/src/Ice/Version.cpp +2 -2
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +26 -2
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +2 -2
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +2 -2
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +11 -0
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +2 -2
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +2 -2
- data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +11 -0
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +1 -3
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +11 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +7 -0
- data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +0 -1
- data/ext/ice/cpp/src/IceUtil/Exception.cpp +2 -1
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +3 -2
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +0 -1
- data/ext/ice/cpp/src/Slice/Parser.cpp +35 -9
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +10 -11
- data/ext/ice/cpp/src/Slice/Python.cpp +54 -36
- data/ext/ice/mcpp/Makefile +10 -0
- data/ext/ice/mcpp/Makefile.mak +23 -15
- data/ice.gemspec +1 -2
- data/lib/Glacier2/Metrics.rb +1 -1
- data/lib/Glacier2/PermissionsVerifier.rb +1 -1
- data/lib/Glacier2/PermissionsVerifierF.rb +1 -1
- data/lib/Glacier2/Router.rb +1 -1
- data/lib/Glacier2/RouterF.rb +1 -1
- data/lib/Glacier2/SSLInfo.rb +1 -1
- data/lib/Glacier2/Session.rb +1 -1
- data/lib/Ice.rb +1 -0
- data/lib/Ice/BuiltinSequences.rb +1 -1
- data/lib/Ice/Communicator.rb +1 -1
- data/lib/Ice/CommunicatorF.rb +1 -1
- data/lib/Ice/Connection.rb +1 -1
- data/lib/Ice/ConnectionF.rb +1 -1
- data/lib/Ice/Current.rb +1 -1
- data/lib/Ice/Endpoint.rb +1 -1
- data/lib/Ice/EndpointF.rb +1 -1
- data/lib/Ice/EndpointTypes.rb +1 -1
- data/lib/Ice/FacetMap.rb +1 -1
- data/lib/Ice/Identity.rb +1 -1
- data/lib/Ice/ImplicitContext.rb +1 -1
- data/lib/Ice/ImplicitContextF.rb +1 -1
- data/lib/Ice/Instrumentation.rb +1 -1
- data/lib/Ice/InstrumentationF.rb +1 -1
- data/lib/Ice/LocalException.rb +1 -1
- data/lib/Ice/Locator.rb +1 -1
- data/lib/Ice/LocatorF.rb +1 -1
- data/lib/Ice/Logger.rb +1 -1
- data/lib/Ice/LoggerF.rb +1 -1
- data/lib/Ice/Metrics.rb +1 -1
- data/lib/Ice/ObjectAdapterF.rb +1 -1
- data/lib/Ice/ObjectFactory.rb +1 -1
- data/lib/Ice/ObjectFactoryF.rb +1 -1
- data/lib/Ice/Plugin.rb +1 -1
- data/lib/Ice/PluginF.rb +1 -1
- data/lib/Ice/Process.rb +1 -1
- data/lib/Ice/ProcessF.rb +1 -1
- data/lib/Ice/Properties.rb +1 -1
- data/lib/Ice/PropertiesAdmin.rb +1 -1
- data/lib/Ice/PropertiesF.rb +1 -1
- data/lib/Ice/RemoteLogger.rb +292 -0
- data/lib/Ice/Router.rb +1 -1
- data/lib/Ice/RouterF.rb +1 -1
- data/lib/Ice/SliceChecksumDict.rb +1 -1
- data/lib/Ice/Version.rb +1 -1
- data/lib/IceBox/IceBox.rb +1 -1
- data/lib/IceGrid/Admin.rb +1 -1
- data/lib/IceGrid/Descriptor.rb +1 -1
- data/lib/IceGrid/Exception.rb +1 -1
- data/lib/IceGrid/FileParser.rb +1 -1
- data/lib/IceGrid/Locator.rb +1 -1
- data/lib/IceGrid/Observer.rb +1 -1
- data/lib/IceGrid/Query.rb +1 -1
- data/lib/IceGrid/Registry.rb +1 -1
- data/lib/IceGrid/Session.rb +1 -1
- data/lib/IceGrid/UserAccountMapper.rb +1 -1
- data/lib/IcePatch2/FileInfo.rb +1 -1
- data/lib/IcePatch2/FileServer.rb +1 -1
- data/lib/IceStorm/IceStorm.rb +1 -1
- data/lib/IceStorm/Metrics.rb +1 -1
- data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +4 -0
- metadata +6 -4
@@ -61,11 +61,11 @@ class SelectorTimeoutException
|
|
61
61
|
|
62
62
|
struct SelectEvent
|
63
63
|
{
|
64
|
-
SelectEvent(
|
64
|
+
SelectEvent(const EventHandlerPtr& handler, SocketOperation status) : handler(handler), status(status)
|
65
65
|
{
|
66
66
|
}
|
67
67
|
|
68
|
-
|
68
|
+
EventHandlerPtr handler;
|
69
69
|
SocketOperation status;
|
70
70
|
};
|
71
71
|
|
@@ -81,9 +81,9 @@ public:
|
|
81
81
|
void update(EventHandler*, SocketOperation, SocketOperation);
|
82
82
|
void finish(EventHandler*);
|
83
83
|
|
84
|
-
|
84
|
+
EventHandlerPtr getNextHandler(SocketOperation&, int);
|
85
85
|
|
86
|
-
void completed(
|
86
|
+
void completed(const EventHandlerPtr&, SocketOperation);
|
87
87
|
|
88
88
|
private:
|
89
89
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
//
|
8
8
|
// **********************************************************************
|
9
9
|
//
|
10
|
-
// Ice version 3.6.
|
10
|
+
// Ice version 3.6.1
|
11
11
|
//
|
12
12
|
// <auto-generated>
|
13
13
|
//
|
@@ -34,7 +34,7 @@
|
|
34
34
|
# if ICE_INT_VERSION % 100 > 50
|
35
35
|
# error Beta header file detected
|
36
36
|
# endif
|
37
|
-
# if ICE_INT_VERSION % 100 <
|
37
|
+
# if ICE_INT_VERSION % 100 < 1
|
38
38
|
# error Ice patch level mismatch!
|
39
39
|
# endif
|
40
40
|
#endif
|
@@ -7,7 +7,7 @@
|
|
7
7
|
//
|
8
8
|
// **********************************************************************
|
9
9
|
//
|
10
|
-
// Ice version 3.6.
|
10
|
+
// Ice version 3.6.1
|
11
11
|
//
|
12
12
|
// <auto-generated>
|
13
13
|
//
|
@@ -33,7 +33,7 @@
|
|
33
33
|
# if ICE_INT_VERSION % 100 > 50
|
34
34
|
# error Beta header file detected
|
35
35
|
# endif
|
36
|
-
# if ICE_INT_VERSION % 100 <
|
36
|
+
# if ICE_INT_VERSION % 100 < 1
|
37
37
|
# error Ice patch level mismatch!
|
38
38
|
# endif
|
39
39
|
#endif
|
@@ -7,7 +7,7 @@
|
|
7
7
|
//
|
8
8
|
// **********************************************************************
|
9
9
|
//
|
10
|
-
// Ice version 3.6.
|
10
|
+
// Ice version 3.6.1
|
11
11
|
//
|
12
12
|
// <auto-generated>
|
13
13
|
//
|
@@ -34,7 +34,7 @@
|
|
34
34
|
# if ICE_INT_VERSION % 100 > 50
|
35
35
|
# error Beta header file detected
|
36
36
|
# endif
|
37
|
-
# if ICE_INT_VERSION % 100 <
|
37
|
+
# if ICE_INT_VERSION % 100 < 1
|
38
38
|
# error Ice patch level mismatch!
|
39
39
|
# endif
|
40
40
|
#endif
|
@@ -105,7 +105,7 @@ StreamSocket::connect(Buffer& readBuffer, Buffer& writeBuffer)
|
|
105
105
|
bool
|
106
106
|
StreamSocket::isConnected()
|
107
107
|
{
|
108
|
-
return _state == StateConnected;
|
108
|
+
return _state == StateConnected && _fd != INVALID_SOCKET;
|
109
109
|
}
|
110
110
|
|
111
111
|
size_t
|
@@ -377,7 +377,7 @@ StreamSocket::startWrite(Buffer& buf)
|
|
377
377
|
void
|
378
378
|
StreamSocket::finishWrite(Buffer& buf)
|
379
379
|
{
|
380
|
-
if(_state < StateConnected && _state != StateProxyWrite)
|
380
|
+
if(_fd == INVALID_SOCKET || (_state < StateConnected && _state != StateProxyWrite))
|
381
381
|
{
|
382
382
|
return;
|
383
383
|
}
|
@@ -439,6 +439,11 @@ StreamSocket::startRead(Buffer& buf)
|
|
439
439
|
void
|
440
440
|
StreamSocket::finishRead(Buffer& buf)
|
441
441
|
{
|
442
|
+
if(_fd == INVALID_SOCKET)
|
443
|
+
{
|
444
|
+
return;
|
445
|
+
}
|
446
|
+
|
442
447
|
if(static_cast<int>(_read.count) == SOCKET_ERROR)
|
443
448
|
{
|
444
449
|
WSASetLastError(_read.error);
|
@@ -63,7 +63,7 @@ createStringConverter(const CommunicatorPtr& communicator, const string& name, c
|
|
63
63
|
return 0;
|
64
64
|
}
|
65
65
|
}
|
66
|
-
|
66
|
+
|
67
67
|
if(cp == -1)
|
68
68
|
{
|
69
69
|
Error out(communicator->getLogger());
|
@@ -100,7 +100,7 @@ createStringConverter(const CommunicatorPtr& communicator, const string& name, c
|
|
100
100
|
return 0;
|
101
101
|
}
|
102
102
|
}
|
103
|
-
|
103
|
+
|
104
104
|
switch(iconvArgs.size())
|
105
105
|
{
|
106
106
|
case 0:
|
@@ -125,7 +125,7 @@ createStringConverter(const CommunicatorPtr& communicator, const string& name, c
|
|
125
125
|
}
|
126
126
|
}
|
127
127
|
|
128
|
-
#endif
|
128
|
+
#endif
|
129
129
|
|
130
130
|
return new StringConverterPlugin(communicator, stringConverter, wstringConverter);
|
131
131
|
}
|
@@ -142,4 +142,16 @@ createStringConverter(const CommunicatorPtr& communicator, const string& name, c
|
|
142
142
|
return 0;
|
143
143
|
}
|
144
144
|
}
|
145
|
+
|
146
|
+
}
|
147
|
+
|
148
|
+
namespace Ice
|
149
|
+
{
|
150
|
+
|
151
|
+
ICE_API void
|
152
|
+
registerIceStringConverter(bool loadOnInitialize)
|
153
|
+
{
|
154
|
+
Ice::registerPluginFactory("IceStringConverter", createStringConverter, loadOnInitialize);
|
155
|
+
}
|
156
|
+
|
145
157
|
}
|
@@ -8,7 +8,6 @@
|
|
8
8
|
// **********************************************************************
|
9
9
|
|
10
10
|
#include <Ice/ThreadPool.h>
|
11
|
-
#include <IceUtil/DisableWarnings.h>
|
12
11
|
#include <Ice/EventHandler.h>
|
13
12
|
#include <Ice/Network.h>
|
14
13
|
#include <Ice/LocalException.h>
|
@@ -40,7 +39,7 @@ public:
|
|
40
39
|
ShutdownWorkItem(const InstancePtr& instance) : _instance(instance)
|
41
40
|
{
|
42
41
|
}
|
43
|
-
|
42
|
+
|
44
43
|
virtual void
|
45
44
|
execute(ThreadPoolCurrent& current)
|
46
45
|
{
|
@@ -51,9 +50,9 @@ public:
|
|
51
50
|
}
|
52
51
|
catch(const CommunicatorDestroyedException&)
|
53
52
|
{
|
54
|
-
}
|
53
|
+
}
|
55
54
|
}
|
56
|
-
|
55
|
+
|
57
56
|
private:
|
58
57
|
|
59
58
|
const InstancePtr _instance;
|
@@ -66,13 +65,13 @@ public:
|
|
66
65
|
FinishedWorkItem(const EventHandlerPtr& handler, bool close) : _handler(handler), _close(close)
|
67
66
|
{
|
68
67
|
}
|
69
|
-
|
68
|
+
|
70
69
|
virtual void
|
71
70
|
execute(ThreadPoolCurrent& current)
|
72
71
|
{
|
73
72
|
_handler->finished(current, _close);
|
74
73
|
}
|
75
|
-
|
74
|
+
|
76
75
|
private:
|
77
76
|
|
78
77
|
const EventHandlerPtr _handler;
|
@@ -133,11 +132,11 @@ class ThreadPoolDestroyedException
|
|
133
132
|
|
134
133
|
}
|
135
134
|
|
136
|
-
IceInternal::DispatchWorkItem::DispatchWorkItem()
|
135
|
+
IceInternal::DispatchWorkItem::DispatchWorkItem()
|
137
136
|
{
|
138
137
|
}
|
139
138
|
|
140
|
-
IceInternal::DispatchWorkItem::DispatchWorkItem(const Ice::ConnectionPtr& connection) : _connection(connection)
|
139
|
+
IceInternal::DispatchWorkItem::DispatchWorkItem(const Ice::ConnectionPtr& connection) : _connection(connection)
|
141
140
|
{
|
142
141
|
}
|
143
142
|
|
@@ -152,7 +151,7 @@ IceInternal::ThreadPoolWorkQueue::ThreadPoolWorkQueue(const InstancePtr& instanc
|
|
152
151
|
_instance(instance),
|
153
152
|
_selector(selector),
|
154
153
|
_destroyed(false)
|
155
|
-
#ifdef ICE_USE_IOCP
|
154
|
+
#ifdef ICE_USE_IOCP
|
156
155
|
, _info(SocketOperationRead)
|
157
156
|
#endif
|
158
157
|
{
|
@@ -181,7 +180,7 @@ IceInternal::ThreadPoolWorkQueue::~ThreadPoolWorkQueue()
|
|
181
180
|
Error out(_instance->initializationData().logger);
|
182
181
|
out << "exception in selector while calling closeSocket():\n" << ex;
|
183
182
|
}
|
184
|
-
|
183
|
+
|
185
184
|
try
|
186
185
|
{
|
187
186
|
closeSocket(_fdIntrWrite);
|
@@ -242,7 +241,7 @@ void
|
|
242
241
|
IceInternal::ThreadPoolWorkQueue::message(ThreadPoolCurrent& current)
|
243
242
|
{
|
244
243
|
ThreadPoolWorkItemPtr workItem;
|
245
|
-
{
|
244
|
+
{
|
246
245
|
Lock sync(*this);
|
247
246
|
if(!_workItems.empty())
|
248
247
|
{
|
@@ -267,7 +266,7 @@ IceInternal::ThreadPoolWorkQueue::message(ThreadPoolCurrent& current)
|
|
267
266
|
{
|
268
267
|
continue;
|
269
268
|
}
|
270
|
-
|
269
|
+
|
271
270
|
SocketException ex(__FILE__, __LINE__);
|
272
271
|
ex.error = getSocketErrno();
|
273
272
|
throw ex;
|
@@ -345,7 +344,7 @@ IceInternal::ThreadPoolWorkQueue::postMessage()
|
|
345
344
|
{
|
346
345
|
continue;
|
347
346
|
}
|
348
|
-
|
347
|
+
|
349
348
|
SocketException ex(__FILE__, __LINE__);
|
350
349
|
ex.error = getSocketErrno();
|
351
350
|
throw ex;
|
@@ -387,7 +386,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p
|
|
387
386
|
int nProcessors = sysInfo.dwNumberOfProcessors;
|
388
387
|
# else
|
389
388
|
int nProcessors = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
|
390
|
-
# endif
|
389
|
+
# endif
|
391
390
|
#endif
|
392
391
|
|
393
392
|
//
|
@@ -416,7 +415,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p
|
|
416
415
|
out << _prefix << ".SizeMax < " << _prefix << ".Size; SizeMax adjusted to Size (" << size << ")";
|
417
416
|
sizeMax = size;
|
418
417
|
}
|
419
|
-
|
418
|
+
|
420
419
|
int sizeWarn = properties->getPropertyAsInt(_prefix + ".SizeWarn");
|
421
420
|
if(sizeWarn != 0 && sizeWarn < size)
|
422
421
|
{
|
@@ -461,7 +460,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p
|
|
461
460
|
stackSize = 0;
|
462
461
|
}
|
463
462
|
const_cast<size_t&>(_stackSize) = static_cast<size_t>(stackSize);
|
464
|
-
|
463
|
+
|
465
464
|
const_cast<bool&>(_hasPriority) = properties->getProperty(_prefix + ".ThreadPriority") != "";
|
466
465
|
const_cast<int&>(_priority) = properties->getPropertyAsInt(_prefix + ".ThreadPriority");
|
467
466
|
if(!_hasPriority)
|
@@ -469,7 +468,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p
|
|
469
468
|
const_cast<bool&>(_hasPriority) = properties->getProperty("Ice.ThreadPriority") != "";
|
470
469
|
const_cast<int&>(_priority) = properties->getPropertyAsInt("Ice.ThreadPriority");
|
471
470
|
}
|
472
|
-
|
471
|
+
|
473
472
|
_workQueue = new ThreadPoolWorkQueue(_instance, _selector);
|
474
473
|
|
475
474
|
if(_instance->traceLevels()->threadPool >= 1)
|
@@ -525,11 +524,11 @@ void
|
|
525
524
|
IceInternal::ThreadPool::destroy()
|
526
525
|
{
|
527
526
|
Lock sync(*this);
|
528
|
-
if(_destroyed)
|
527
|
+
if(_destroyed)
|
529
528
|
{
|
530
529
|
return;
|
531
530
|
}
|
532
|
-
|
531
|
+
|
533
532
|
_destroyed = true;
|
534
533
|
_workQueue->destroy();
|
535
534
|
}
|
@@ -568,7 +567,7 @@ IceInternal::ThreadPool::update(const EventHandlerPtr& handler, SocketOperation
|
|
568
567
|
{
|
569
568
|
return;
|
570
569
|
}
|
571
|
-
|
570
|
+
|
572
571
|
_selector.update(handler.get(), remove, add);
|
573
572
|
#if !defined(ICE_USE_IOCP) && !defined(ICE_OS_WINRT)
|
574
573
|
if(add & SocketOperationRead && handler->_hasMoreData && !(handler->_disabled & SocketOperationRead))
|
@@ -598,7 +597,7 @@ IceInternal::ThreadPool::finish(const EventHandlerPtr& handler, bool closeNow)
|
|
598
597
|
return closeNow;
|
599
598
|
#else
|
600
599
|
// If there are no pending asynchronous operations, we can call finish on the handler now.
|
601
|
-
if(!handler->_pending)
|
600
|
+
if(!(handler->_pending & SocketOperationWaitForClose))
|
602
601
|
{
|
603
602
|
_workQueue->queue(new FinishedWorkItem(handler, false));
|
604
603
|
_selector.finish(handler.get());
|
@@ -640,7 +639,7 @@ IceInternal::ThreadPool::dispatchFromThisThread(const DispatchWorkItemPtr& workI
|
|
640
639
|
else
|
641
640
|
{
|
642
641
|
workItem->run();
|
643
|
-
}
|
642
|
+
}
|
644
643
|
}
|
645
644
|
|
646
645
|
void
|
@@ -699,7 +698,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
699
698
|
catch(const exception& ex)
|
700
699
|
{
|
701
700
|
Error out(_instance->initializationData().logger);
|
702
|
-
out << "exception in `" << _prefix << "':\n" << ex << "\nevent handler: "
|
701
|
+
out << "exception in `" << _prefix << "':\n" << ex << "\nevent handler: "
|
703
702
|
<< current._handler->toString();
|
704
703
|
}
|
705
704
|
catch(...)
|
@@ -759,7 +758,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
759
758
|
if(!current._ioCompleted)
|
760
759
|
{
|
761
760
|
//
|
762
|
-
// The handler didn't call ioCompleted() so we take care of decreasing
|
761
|
+
// The handler didn't call ioCompleted() so we take care of decreasing
|
763
762
|
// the IO thread count now.
|
764
763
|
//
|
765
764
|
--_inUseIO;
|
@@ -831,9 +830,9 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
831
830
|
if(!current._handler)
|
832
831
|
{
|
833
832
|
//
|
834
|
-
// If there are no more ready handlers and there are still threads busy performing
|
833
|
+
// If there are no more ready handlers and there are still threads busy performing
|
835
834
|
// IO, we give up leadership and promote another follower (which will perform the
|
836
|
-
// select() only once all the IOs are completed). Otherwise, if there are no more
|
835
|
+
// select() only once all the IOs are completed). Otherwise, if there are no more
|
837
836
|
// threads peforming IOs, it's time to do another select().
|
838
837
|
//
|
839
838
|
if(_inUseIO > 0)
|
@@ -881,7 +880,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
881
880
|
if(_sizeMax > 1)
|
882
881
|
{
|
883
882
|
Lock sync(*this);
|
884
|
-
|
883
|
+
|
885
884
|
if(_destroyed)
|
886
885
|
{
|
887
886
|
continue;
|
@@ -904,14 +903,14 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
904
903
|
_threads.erase(thread);
|
905
904
|
_workQueue->queue(new JoinThreadWorkItem(thread));
|
906
905
|
return;
|
907
|
-
}
|
906
|
+
}
|
908
907
|
else if(_inUse > 0)
|
909
908
|
{
|
910
909
|
//
|
911
910
|
// If this is the last idle thread but there are still other threads
|
912
911
|
// busy dispatching, we go back waiting with _threadIdleTime. We only
|
913
912
|
// wait with _serverIdleTime when there's only one thread left.
|
914
|
-
//
|
913
|
+
//
|
915
914
|
continue;
|
916
915
|
}
|
917
916
|
assert(_threads.size() == 1);
|
@@ -964,7 +963,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
964
963
|
// because the wide string is using the platform default encoding.
|
965
964
|
//
|
966
965
|
Error out(_instance->initializationData().logger);
|
967
|
-
out << "exception in `" << _prefix << "':\n"
|
966
|
+
out << "exception in `" << _prefix << "':\n"
|
968
967
|
<< IceUtil::wstringToString(ex->Message->Data(), _instance->getStringConverter())
|
969
968
|
<< "\nevent handler: " << current._handler->toString();
|
970
969
|
}
|
@@ -999,7 +998,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
|
|
999
998
|
|
1000
999
|
if(_sizeMax > 1)
|
1001
1000
|
{
|
1002
|
-
|
1001
|
+
|
1003
1002
|
#if !defined(ICE_USE_IOCP) && !defined(ICE_OS_WINRT)
|
1004
1003
|
--_inUseIO;
|
1005
1004
|
|
@@ -1039,16 +1038,16 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
|
|
1039
1038
|
|
1040
1039
|
assert(_inUse >= 0);
|
1041
1040
|
++_inUse;
|
1042
|
-
|
1041
|
+
|
1043
1042
|
if(_inUse == _sizeWarn)
|
1044
1043
|
{
|
1045
1044
|
Warning out(_instance->initializationData().logger);
|
1046
1045
|
out << "thread pool `" << _prefix << "' is running low on threads\n"
|
1047
1046
|
<< "Size=" << _size << ", " << "SizeMax=" << _sizeMax << ", " << "SizeWarn=" << _sizeWarn;
|
1048
1047
|
}
|
1049
|
-
|
1048
|
+
|
1050
1049
|
if(!_destroyed)
|
1051
|
-
{
|
1050
|
+
{
|
1052
1051
|
assert(_inUse <= static_cast<int>(_threads.size()));
|
1053
1052
|
if(_inUse < _sizeMax && _inUse == static_cast<int>(_threads.size()))
|
1054
1053
|
{
|
@@ -1057,7 +1056,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
|
|
1057
1056
|
Trace out(_instance->initializationData().logger, _instance->traceLevels()->threadPoolCat);
|
1058
1057
|
out << "growing " << _prefix << ": Size=" << _threads.size() + 1;
|
1059
1058
|
}
|
1060
|
-
|
1059
|
+
|
1061
1060
|
try
|
1062
1061
|
{
|
1063
1062
|
EventHandlerThreadPtr thread = new EventHandlerThread(this, nextThreadId());
|
@@ -1104,7 +1103,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current)
|
|
1104
1103
|
if(!current._handler->finishAsync(current.operation)) // Returns false if the handler is finished.
|
1105
1104
|
{
|
1106
1105
|
current._handler->_pending = static_cast<SocketOperation>(current._handler->_pending & ~current.operation);
|
1107
|
-
if(!current._handler->_pending && current._handler->_finish)
|
1106
|
+
if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish)
|
1108
1107
|
{
|
1109
1108
|
_workQueue->queue(new FinishedWorkItem(current._handler, false));
|
1110
1109
|
_selector.finish(current._handler.get());
|
@@ -1118,7 +1117,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current)
|
|
1118
1117
|
if(!current._handler->startAsync(current.operation))
|
1119
1118
|
{
|
1120
1119
|
current._handler->_pending = static_cast<SocketOperation>(current._handler->_pending & ~current.operation);
|
1121
|
-
if(!current._handler->_pending && current._handler->_finish)
|
1120
|
+
if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish)
|
1122
1121
|
{
|
1123
1122
|
_workQueue->queue(new FinishedWorkItem(current._handler, false));
|
1124
1123
|
_selector.finish(current._handler.get());
|
@@ -1141,7 +1140,7 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current)
|
|
1141
1140
|
else
|
1142
1141
|
{
|
1143
1142
|
current._handler->_pending = static_cast<SocketOperation>(current._handler->_pending & ~current.operation);
|
1144
|
-
if(!current._handler->_pending && current._handler->_finish)
|
1143
|
+
if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish)
|
1145
1144
|
{
|
1146
1145
|
_workQueue->queue(new FinishedWorkItem(current._handler, false));
|
1147
1146
|
_selector.finish(current._handler.get());
|
@@ -1171,7 +1170,7 @@ IceInternal::ThreadPool::finishMessage(ThreadPoolCurrent& current)
|
|
1171
1170
|
current._handler->_pending = static_cast<SocketOperation>(current._handler->_pending & ~current.operation);
|
1172
1171
|
}
|
1173
1172
|
|
1174
|
-
if(!current._handler->_pending && current._handler->_finish)
|
1173
|
+
if(!(current._handler->_pending & SocketOperationWaitForClose) && current._handler->_finish)
|
1175
1174
|
{
|
1176
1175
|
// There are no more pending async operations, it's time to call finish.
|
1177
1176
|
_workQueue->queue(new FinishedWorkItem(current._handler, false));
|
@@ -1195,7 +1194,7 @@ bool
|
|
1195
1194
|
IceInternal::ThreadPool::followerWait(ThreadPoolCurrent& current)
|
1196
1195
|
{
|
1197
1196
|
assert(!current._leader);
|
1198
|
-
|
1197
|
+
|
1199
1198
|
current._thread->setState(ThreadStateIdle);
|
1200
1199
|
|
1201
1200
|
//
|
@@ -1216,7 +1215,7 @@ IceInternal::ThreadPool::followerWait(ThreadPoolCurrent& current)
|
|
1216
1215
|
{
|
1217
1216
|
if(!timedWait(IceUtil::Time::seconds(_threadIdleTime)))
|
1218
1217
|
{
|
1219
|
-
if(!_destroyed && (!_promote || _inUseIO == _sizeIO ||
|
1218
|
+
if(!_destroyed && (!_promote || _inUseIO == _sizeIO ||
|
1220
1219
|
(_nextHandler == _handlers.end() && _inUseIO > 0)))
|
1221
1220
|
{
|
1222
1221
|
if(_instance->traceLevels()->threadPool >= 1)
|
@@ -1246,7 +1245,7 @@ string
|
|
1246
1245
|
IceInternal::ThreadPool::nextThreadId()
|
1247
1246
|
{
|
1248
1247
|
ostringstream os;
|
1249
|
-
os << _prefix << "-" << _nextThreadId++;
|
1248
|
+
os << _prefix << "-" << _nextThreadId++;
|
1250
1249
|
return os.str();
|
1251
1250
|
}
|
1252
1251
|
|
@@ -1316,7 +1315,7 @@ IceInternal::ThreadPool::EventHandlerThread::run()
|
|
1316
1315
|
catch(...)
|
1317
1316
|
{
|
1318
1317
|
Error out(_pool->_instance->initializationData().logger);
|
1319
|
-
out << "unknown exception in `" << _pool->_prefix << "'";
|
1318
|
+
out << "unknown exception in `" << _pool->_prefix << "'";
|
1320
1319
|
}
|
1321
1320
|
|
1322
1321
|
_observer.detach();
|
@@ -1342,12 +1341,12 @@ IceInternal::ThreadPool::EventHandlerThread::run()
|
|
1342
1341
|
_pool = 0; // Break cyclic dependency.
|
1343
1342
|
}
|
1344
1343
|
|
1345
|
-
ThreadPoolCurrent::ThreadPoolCurrent(const InstancePtr& instance,
|
1344
|
+
ThreadPoolCurrent::ThreadPoolCurrent(const InstancePtr& instance,
|
1346
1345
|
const ThreadPoolPtr& threadPool,
|
1347
1346
|
const ThreadPool::EventHandlerThreadPtr& thread) :
|
1348
|
-
operation(SocketOperationNone),
|
1349
|
-
stream(instance.get(), Ice::currentProtocolEncoding),
|
1350
|
-
_threadPool(threadPool.get()),
|
1347
|
+
operation(SocketOperationNone),
|
1348
|
+
stream(instance.get(), Ice::currentProtocolEncoding),
|
1349
|
+
_threadPool(threadPool.get()),
|
1351
1350
|
_thread(thread),
|
1352
1351
|
_ioCompleted(false)
|
1353
1352
|
#if !defined(ICE_USE_IOCP) && !defined(ICE_OS_WINRT)
|