summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-07-10 15:40:02 +0200
committerBenoit Foucher <benoit@zeroc.com>2007-07-10 15:40:02 +0200
commitba711b2eaa97aad7124f4e853ff17d3cbf7519c6 (patch)
tree2c51fda8446cc5b52a9d944defdbcca0588e2fa7
parentFixed bug 2292 (diff)
downloadice-ba711b2eaa97aad7124f4e853ff17d3cbf7519c6.tar.bz2
ice-ba711b2eaa97aad7124f4e853ff17d3cbf7519c6.tar.xz
ice-ba711b2eaa97aad7124f4e853ff17d3cbf7519c6.zip
Fixed bug 2293
-rw-r--r--cpp/CHANGES5
-rw-r--r--cpp/src/IceUtil/Thread.cpp10
2 files changed, 15 insertions, 0 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index b563a40f837..517793780c2 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,11 @@
Changes since version 3.2.X (binary incompatible)
-------------------------------------------------
+- The thread stack size specified with the IceUtil::Thread::start()
+ method parameter is now adjusted to PTHREAD_STACK_MIN if it's
+ inferior to it. On Mac OS X, it's also adjusted to the next closest
+ multiple of the page size (4KB).
+
- The property Ice.Trace.Location has been deprecated and replaced
by Ice.Trace.Locator.
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index 70c4aa8b52c..6f306f345de 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -406,6 +406,16 @@ IceUtil::Thread::start(size_t stackSize)
__decRef();
throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
+ if(stackSize < PTHREAD_STACK_MIN)
+ {
+ stackSize = PTHREAD_STACK_MIN;
+ }
+#ifdef __APPLE__
+ if(stackSize % 4096 > 0)
+ {
+ stackSize = stackSize / 4096 * 4096 + 4096;
+ }
+#endif
rc = pthread_attr_setstacksize(&attr, stackSize);
if(rc != 0)
{