Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_thread_qfuturesynchronizer.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5
void
someFunction
()
6
{
7
QFutureSynchronizer<void> synchronizer;
8
9
...
10
11
synchronizer.addFuture(
QtConcurrent::run
(anotherFunction));
12
synchronizer.addFuture(
QtConcurrent::map
(
list
, mapFunction));
13
14
return
;
// QFutureSynchronizer waits for all futures to finish
15
}
QtConcurrent::run
QTCONCURRENT_RUN_NODISCARD auto run(QThreadPool *pool, Function &&f, Args &&...args)
Definition
qtconcurrentrun.h:43
QtConcurrent::map
QFuture< void > map(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map)
Calls function once for each item in sequence.
Definition
qtconcurrentmap.h:27
list
QList< int > list
[14]
Definition
src_concurrent_qtconcurrentfilter.cpp:140
someFunction
void someFunction()
[0]
Definition
src_corelib_thread_qfuturesynchronizer.cpp:5
qtbase
src
corelib
doc
snippets
code
src_corelib_thread_qfuturesynchronizer.cpp
Generated by
1.10.0