summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-05-03 16:10:26 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-05-07 14:22:27 -0700
commit3fc5ee5c2e4ed919b2939ca54a1958b8463eb404 (patch)
tree6ecbf915bb424d38baaf346c95d209617b338bbc /src/corelib/thread
parented70faf87af42dea290853730093b3c2ecb90b0e (diff)
QThread/Doc: update the docs on setStackSize()
There's some confusion about minimum and maximum. Pick-to: 6.7 Fixes: QTBUG-109512 Change-Id: I262c3499666e4f4fbcfbfffd17cc1d592bc658b3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Philip Van Hoof <philip@codeminded.be>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 8d8f353aaa..ea76a2ccad 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -531,10 +531,18 @@ bool QThread::isRunning() const
}
/*!
- Sets the maximum stack size for the thread to \a stackSize. If \a
- stackSize is greater than zero, the maximum stack size is set to
- \a stackSize bytes, otherwise the maximum stack size is
- automatically determined by the operating system.
+ Sets the stack size for the thread to \a stackSize. If \a stackSize is
+ zero, the operating system or runtime will choose a default value.
+ Otherwise, the thread's stack size will be the value provided (which may be
+ rounded up or down).
+
+ On most operating systems, the amount of memory allocated to serve the
+ stack will initially be smaller than \a stackSize and will grow as the
+ thread uses the stack. This parameter sets the maximum size it will be
+ allowed to grow to (that is, it sets the size of the virtual memory space
+ the stack is allowed to occupy).
+
+ This function can only be called before the thread is started.
\warning Most operating systems place minimum and maximum limits
on thread stack sizes. The thread will fail to start if the stack