Qt
6.x
The Qt SDK
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
}
QFutureSynchronizer
Definition
qfuturesynchronizer.h:16
QFutureSynchronizer::addFuture
void addFuture(QFuture< T > future)
Definition
qfuturesynchronizer.h:34
QtConcurrent::map
QFuture< void > map(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map)
Calls function once for each item in sequence.
Definition
qtconcurrentmap.h:27
QtConcurrent::run
auto run(QThreadPool *pool, Function &&f, Args &&...args)
Definition
qtconcurrentrun.h:40
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.9.7