diff options
Diffstat (limited to 'src/concurrent/qtconcurrentrun.cpp')
-rw-r--r-- | src/concurrent/qtconcurrentrun.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index fc19b947e5..017f2df480 100644 --- a/src/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp @@ -80,6 +80,10 @@ \snippet code/src_concurrent_qtconcurrentrun.cpp 2 + If you don't need the result (for example, because the function returns + \c{void}), using the QThreadPool::start() overload taking a function object + is more efficient. + As documented above, passing arguments is done like this: \snippet code/src_concurrent_qtconcurrentrun.cpp 3 @@ -220,7 +224,7 @@ */ /*! - \fn QFuture<T> QtConcurrent::run(Function function, ...); + \fn template <typename T> QFuture<T> QtConcurrent::run(Function function, ...); Equivalent to \code @@ -251,17 +255,16 @@ running task, fetching multiple results from the called \a function or monitoring progress reported by the \a function. - \sa {Concurrent Run (basic mode)}, {Concurrent Run With Promise} + \sa {Concurrent Run (basic mode)}, {Concurrent Run With Promise}, QThreadPool::start() //! [run-description] */ /*! \since 5.4 - \fn QFuture<T> QtConcurrent::run(QThreadPool *pool, Function function, ...); + \fn template <typename T> QFuture<T> QtConcurrent::run(QThreadPool *pool, Function function, ...); - Runs \a function in a separate thread. The thread is taken from the - QThreadPool \a pool. Note that \a function may not run immediately; \a function - will only be run once a thread becomes available. + Schedules \a function on \a pool. Note that \a function may not run + immediately; \a function will only be run once a thread becomes available. \include qtconcurrentrun.cpp run-description */ |