summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-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)
{