summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2019-05-08 16:17:26 -0400
committerJoe George <joe@zeroc.com>2019-05-09 09:17:14 -0400
commitc4f7795cec0525ce456293eec2ced75b9447d475 (patch)
treeaf392ee7abad5af6c398ff9e3b3594115df88cc0
parentAdd/remove leading underscores (diff)
downloadice-c4f7795cec0525ce456293eec2ced75b9447d475.tar.bz2
ice-c4f7795cec0525ce456293eec2ced75b9447d475.tar.xz
ice-c4f7795cec0525ce456293eec2ced75b9447d475.zip
Fix dispatch queue label
-rw-r--r--cpp/src/Ice/ThreadPool.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 7ffb9016a1e..f1be4dcb8dc 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -110,6 +110,29 @@ class ThreadPoolDestroyedException
{
};
+#ifdef ICE_SWIFT
+string
+prefixToDispatchQueueLabel(const std::string& prefix)
+{
+ if(prefix == "Ice.ThreadPool.Client")
+ {
+ return "com.zeroc.ice.client";
+ }
+
+ if(prefix == "Ice.ThreadPool.Server")
+ {
+ return "com.zeroc.ice.server";
+ }
+
+ string::size_type end = prefix.find_last_of(".ThreadPool");
+ if(end == string::npos)
+ {
+ end = prefix.size();
+ }
+
+ return "com.zeroc.ice.oa." + prefix.substr(0, end);
+}
+#endif
}
Ice::DispatcherCall::~DispatcherCall()
@@ -246,7 +269,7 @@ IceInternal::ThreadPoolWorkQueue::getNativeInfo()
IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& prefix, int timeout) :
_instance(instance),
#ifdef ICE_SWIFT
- _dispatchQueue(dispatch_queue_create(("com.zeroc." + prefix).c_str(), DISPATCH_QUEUE_CONCURRENT)),
+ _dispatchQueue(dispatch_queue_create(prefixToDispatchQueueLabel(prefix).c_str(), DISPATCH_QUEUE_CONCURRENT)),
#else
_dispatcher(_instance->initializationData().dispatcher),
#endif