summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-07-16 14:50:48 (GMT)
committeraxis <qt-info@nokia.com>2009-07-16 15:02:23 (GMT)
commit9324fddeb081a5f1cef9229d15a7799df17d02fa (patch)
tree403535fe2f540d0a8c5db5d2df5d07ca3fa0c910 /src
parentce698fec72fcca514269fe48642161b69687f7bd (diff)
downloadQt-9324fddeb081a5f1cef9229d15a7799df17d02fa.zip
Qt-9324fddeb081a5f1cef9229d15a7799df17d02fa.tar.gz
Qt-9324fddeb081a5f1cef9229d15a7799df17d02fa.tar.bz2
Increased default stack size for QThreads on Symbian.
It can be debated whether this is a bug or not, and whether or not we should rely on the Symbian default. Our rationale was that the default size caused even the simplest tasks to fail (the task talked about a file copy crashing), so we decided to increase the headroom. Those that want to minimize the stack size can do so manually with setStackSize(). We go by the old API design slogan: Make the simple tasks easy, and the advanced tasks possible. RevBy: Jason Barron Task: 253666
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qthread_unix.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 6009a0a..881b889 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -470,6 +470,13 @@ void QThread::start(Priority priority)
}
#endif // _POSIX_THREAD_PRIORITY_SCHEDULING
+#ifdef Q_OS_SYMBIAN
+ if (d->stackSize == 0)
+ // The default stack size on Symbian is very small, making even basic
+ // operations like file I/O fail, so we increase it by default.
+ d->stackSize = 0x14000; // Maximum stack size on Symbian.
+#endif
+
if (d->stackSize > 0) {
#if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0)
int code = pthread_attr_setstacksize(&attr, d->stackSize);