summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
-rw-r--r--src/corelib/thread/qthreadpool.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index 71310b0ebf..9937201619 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -74,7 +74,9 @@ public:
*/
QThreadPoolThread::QThreadPoolThread(QThreadPoolPrivate *manager)
:manager(manager), runnable(0)
-{ }
+{
+ setStackSize(manager->stackSize);
+}
/*
\internal
@@ -604,6 +606,30 @@ void QThreadPool::reserveThread()
++d->reservedThreads;
}
+/*! \property QThreadPool::stacksize
+
+ This property contains the stack size for the thread pool worker
+ threads.
+
+ The value of the property is uses when the thread pool creates
+ new threads only. Changing it has no effect for already created
+ or running threads.
+
+ The default value is 0, which makes QThread use the operating
+ system default stack stize.
+*/
+void QThreadPool::setStackSize(uint stackSize)
+{
+ Q_D(QThreadPool);
+ d->stackSize = stackSize;
+}
+
+uint QThreadPool::stackSize() const
+{
+ Q_D(const QThreadPool);
+ return d->stackSize;
+}
+
/*!
Releases a thread previously reserved by a call to reserveThread().