summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-02-06 08:15:36 +0100
committerTopi Reinio <topi.reinio@qt.io>2025-02-28 13:51:18 +0000
commitb7a67b46e66f161def5bf879f19c66d3fcec1d8b (patch)
treefeb68ba2f835a8aeced04ad3563230db49ecb011 /src/corelib/thread/qthreadpool.cpp
parent6f89357f59b507c0dcdc177bc1ecfbbc94d6fed3 (diff)
Long live \constraints!
We have divergence in the way we document function, operator and constructor constraints. About half use \note, while the other doesn't. Some say "if and only if" while others say just "participates only if". So add a qdoc macro, \constraints, to semantically mark up these constraints. It expands to a section titled `Constraints`, and uses a predefined sentence (prefix) for constraints. Documentation for constraints is moved to the end of the comment blocks to separate them from the rest of the text. Apply them to all the standard-ish constraint documentation blocks (grepped for "participate"). I didn't look for other, one-off, ways documentation authors may have documented constraints, but I'm also not aware of any. Re-wrap lines only if the result fits into a single line. As a drive-by, drop additional "if"s, as in "only if X and -if- Y" to make the texts work with the `Constraints` section. Fixes: QTBUG-106871 Pick-to: 6.9 6.8 6.5 Change-Id: I18c2f9f734474017264e49165389f8c9c7f34030 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
-rw-r--r--src/corelib/thread/qthreadpool.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index a975efde607..a0ac3e58759 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -512,11 +512,11 @@ void QThreadPool::start(QRunnable *runnable, int priority)
\a callableToRun is added to a run queue instead. The \a priority argument can
be used to control the run queue's order of execution.
- \note This function participates in overload resolution only if \c Callable
- is a function or function object which can be called with zero arguments.
-
\note In Qt version prior to 6.6, this function took std::function<void()>,
and therefore couldn't handle move-only callables.
+
+ \constraints \c Callable
+ is a function or function object which can be called with zero arguments.
*/
/*!
@@ -558,11 +558,11 @@ bool QThreadPool::tryStart(QRunnable *runnable)
does nothing and returns \c false. Otherwise, \a callableToRun is run immediately
using one available thread and this function returns \c true.
- \note This function participates in overload resolution only if \c Callable
- is a function or function object which can be called with zero arguments.
-
\note In Qt version prior to 6.6, this function took std::function<void()>,
and therefore couldn't handle move-only callables.
+
+ \constraints \c Callable
+ is a function or function object which can be called with zero arguments.
*/
/*! \property QThreadPool::expiryTimeout
@@ -820,11 +820,11 @@ void QThreadPool::startOnReservedThread(QRunnable *runnable)
Releases a thread previously reserved with reserveThread() and uses it
to run \a callableToRun.
- \note This function participates in overload resolution only if \c Callable
- is a function or function object which can be called with zero arguments.
-
\note In Qt version prior to 6.6, this function took std::function<void()>,
and therefore couldn't handle move-only callables.
+
+ \constraints \c Callable
+ is a function or function object which can be called with zero arguments.
*/
/*!