From 9324fddeb081a5f1cef9229d15a7799df17d02fa Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 16 Jul 2009 16:50:48 +0200 Subject: 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 --- src/corelib/thread/qthread_unix.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- cgit v0.12