diff options
author | Lars Knoll <[email protected]> | 2012-02-03 14:17:26 +0100 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2012-02-05 17:49:16 +0100 |
commit | 96501b0a18f4f70048403dccc4cb42dd71db8f9d (patch) | |
tree | ec4b95139854d1116ad75467c3c08df39fafeb27 | |
parent | c8156cab81690526adffa22214657fc1c6563b8b (diff) |
Move QtConcurrent into its own module
Task-number: QTBUG-20892
Change-Id: I614500aafb6428915509983608bbb0ade4e4f016
Reviewed-by: Thiago Macieira <[email protected]>
-rwxr-xr-x | bin/fixqt4headers.pl | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/imagescaling/imagescaling.h | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/imagescaling/imagescaling.pro | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/imagescaling/main.cpp | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/map/map.pro | 3 | ||||
-rw-r--r-- | examples/qtconcurrent/progressdialog/main.cpp | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/progressdialog/progressdialog.pro | 2 | ||||
-rw-r--r-- | examples/qtconcurrent/runfunction/runfunction.pro | 2 | ||||
-rw-r--r-- | examples/qtconcurrent/wordcount/wordcount.pro | 2 | ||||
-rw-r--r-- | examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp | 2 | ||||
-rw-r--r-- | examples/tutorials/threads/helloconcurrent/helloconcurrent.pro | 1 | ||||
-rw-r--r-- | src/concurrent/concurrent.pro | 59 | ||||
-rw-r--r-- | src/concurrent/qfuture.cpp (renamed from src/corelib/concurrent/qfuture.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qfuture.h (renamed from src/corelib/concurrent/qfuture.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qfutureinterface.cpp (renamed from src/corelib/concurrent/qfutureinterface.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qfutureinterface.h (renamed from src/corelib/concurrent/qfutureinterface.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qfutureinterface_p.h (renamed from src/corelib/concurrent/qfutureinterface_p.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qfuturesynchronizer.cpp (renamed from src/corelib/concurrent/qfuturesynchronizer.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qfuturesynchronizer.h (renamed from src/corelib/concurrent/qfuturesynchronizer.h) | 2 | ||||
-rw-r--r-- | src/concurrent/qfuturewatcher.cpp (renamed from src/corelib/concurrent/qfuturewatcher.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qfuturewatcher.h (renamed from src/corelib/concurrent/qfuturewatcher.h) | 2 | ||||
-rw-r--r-- | src/concurrent/qfuturewatcher_p.h (renamed from src/corelib/concurrent/qfuturewatcher_p.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentcompilertest.h (renamed from src/corelib/concurrent/qtconcurrentcompilertest.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentexception.cpp (renamed from src/corelib/concurrent/qtconcurrentexception.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentexception.h (renamed from src/corelib/concurrent/qtconcurrentexception.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfilter.cpp (renamed from src/corelib/concurrent/qtconcurrentfilter.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfilter.h (renamed from src/corelib/concurrent/qtconcurrentfilter.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfilterkernel.h (renamed from src/corelib/concurrent/qtconcurrentfilterkernel.h) | 6 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentfunctionwrappers.h (renamed from src/corelib/concurrent/qtconcurrentfunctionwrappers.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.cpp (renamed from src/corelib/concurrent/qtconcurrentiteratekernel.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.h (renamed from src/corelib/concurrent/qtconcurrentiteratekernel.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmap.cpp (renamed from src/corelib/concurrent/qtconcurrentmap.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmap.h (renamed from src/corelib/concurrent/qtconcurrentmap.h) | 6 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmapkernel.h (renamed from src/corelib/concurrent/qtconcurrentmapkernel.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentmedian.h (renamed from src/corelib/concurrent/qtconcurrentmedian.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentreducekernel.h (renamed from src/corelib/concurrent/qtconcurrentreducekernel.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentresultstore.cpp (renamed from src/corelib/concurrent/qtconcurrentresultstore.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentresultstore.h (renamed from src/corelib/concurrent/qtconcurrentresultstore.h) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentrun.cpp (renamed from src/corelib/concurrent/qtconcurrentrun.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentrun.h (renamed from src/corelib/concurrent/qtconcurrentrun.h) | 4 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentrunbase.h (renamed from src/corelib/concurrent/qtconcurrentrunbase.h) | 2 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentstoredfunctioncall.h (renamed from src/corelib/concurrent/qtconcurrentstoredfunctioncall.h) | 2 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentthreadengine.cpp (renamed from src/corelib/concurrent/qtconcurrentthreadengine.cpp) | 0 | ||||
-rw-r--r-- | src/concurrent/qtconcurrentthreadengine.h (renamed from src/corelib/concurrent/qtconcurrentthreadengine.h) | 4 | ||||
-rw-r--r-- | src/corelib/concurrent/concurrent.pri | 42 | ||||
-rw-r--r-- | src/corelib/corelib.pro | 1 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 2 | ||||
-rw-r--r-- | src/corelib/thread/qrunnable.cpp (renamed from src/corelib/concurrent/qrunnable.cpp) | 0 | ||||
-rw-r--r-- | src/corelib/thread/qrunnable.h (renamed from src/corelib/concurrent/qrunnable.h) | 0 | ||||
-rw-r--r-- | src/corelib/thread/qthreadpool.cpp (renamed from src/corelib/concurrent/qthreadpool.cpp) | 0 | ||||
-rw-r--r-- | src/corelib/thread/qthreadpool.h (renamed from src/corelib/concurrent/qthreadpool.h) | 0 | ||||
-rw-r--r-- | src/corelib/thread/qthreadpool_p.h (renamed from src/corelib/concurrent/qthreadpool_p.h) | 2 | ||||
-rw-r--r-- | src/corelib/thread/thread.pri | 7 | ||||
-rw-r--r-- | src/modules/qt_concurrent.pri | 15 | ||||
-rw-r--r-- | src/src.pro | 4 | ||||
-rw-r--r-- | sync.profile | 4 | ||||
-rw-r--r-- | tests/auto/auto.pro | 4 | ||||
-rw-r--r-- | tests/auto/concurrent/concurrent.pro (renamed from tests/auto/corelib/concurrent/concurrent.pro) | 3 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuture/.gitignore (renamed from tests/auto/corelib/concurrent/qfuture/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuture/qfuture.pro (renamed from tests/auto/corelib/concurrent/qfuture/qfuture.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuture/tst_qfuture.cpp (renamed from tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro (renamed from tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp (renamed from tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp) | 4 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuturewatcher/.gitignore (renamed from tests/auto/corelib/concurrent/qfuturewatcher/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro (renamed from tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp (renamed from tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp) | 5 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentfilter/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentmap/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentmap/functions.h (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/functions.h) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentrun/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentthreadengine/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro) | 2 | ||||
-rw-r--r-- | tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 82 | ||||
-rw-r--r-- | tests/auto/corelib/corelib.pro | 2 | ||||
-rw-r--r-- | tests/auto/corelib/thread/qthreadpool/.gitignore (renamed from tests/auto/corelib/concurrent/qthreadpool/.gitignore) | 0 | ||||
-rw-r--r-- | tests/auto/corelib/thread/qthreadpool/qthreadpool.pro (renamed from tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro) | 0 | ||||
-rw-r--r-- | tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp (renamed from tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/corelib/thread/thread.pro | 1 |
91 files changed, 204 insertions, 124 deletions
diff --git a/bin/fixqt4headers.pl b/bin/fixqt4headers.pl index 3516168dc2d..2c92f727b7d 100755 --- a/bin/fixqt4headers.pl +++ b/bin/fixqt4headers.pl @@ -141,6 +141,7 @@ sub findQtHeaders die "This script requires the QTDIR environment variable pointing to Qt 5\n" unless $qtdir; findQtHeaders('QtCore', $qtdir); +findQtHeaders('QtConcurrent', $qtdir); findQtHeaders('QtWidgets', $qtdir); findQtHeaders('QtPrintSupport', $qtdir); diff --git a/examples/qtconcurrent/imagescaling/imagescaling.h b/examples/qtconcurrent/imagescaling/imagescaling.h index 204a297ef3e..1f68a3838ae 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.h +++ b/examples/qtconcurrent/imagescaling/imagescaling.h @@ -41,6 +41,7 @@ #define IMAGESCALING_H #include <QtWidgets> +#include <QtConcurrent> #ifndef QT_NO_CONCURRENT diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro index 2ec5abddf68..b268aa75f2e 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.pro +++ b/examples/qtconcurrent/imagescaling/imagescaling.pro @@ -1,6 +1,7 @@ TEMPLATE = app DEPENDPATH += . INCLUDEPATH += . +QT += concurrent # Input SOURCES += main.cpp imagescaling.cpp diff --git a/examples/qtconcurrent/imagescaling/main.cpp b/examples/qtconcurrent/imagescaling/main.cpp index f7a359c2afc..9fef7d3100b 100644 --- a/examples/qtconcurrent/imagescaling/main.cpp +++ b/examples/qtconcurrent/imagescaling/main.cpp @@ -38,6 +38,7 @@ ** ****************************************************************************/ #include <QtWidgets> +#include <QtConcurrent> #ifndef QT_NO_CONCURRENT diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro index 978eae44b91..72f770755f3 100644 --- a/examples/qtconcurrent/map/map.pro +++ b/examples/qtconcurrent/map/map.pro @@ -2,6 +2,7 @@ TEMPLATE = app TARGET = mapdemo DEPENDPATH += . INCLUDEPATH += . +QT += concurrent widgets # Input SOURCES += main.cpp @@ -13,6 +14,4 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map INSTALLS += target sources -QT += widgets - simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp index b26824c1721..87ea4f5486a 100644 --- a/examples/qtconcurrent/progressdialog/main.cpp +++ b/examples/qtconcurrent/progressdialog/main.cpp @@ -39,6 +39,7 @@ ****************************************************************************/ #include <QtWidgets> +#include <QtConcurrent> #ifndef QT_NO_CONCURRENT diff --git a/examples/qtconcurrent/progressdialog/progressdialog.pro b/examples/qtconcurrent/progressdialog/progressdialog.pro index fbc239d199e..75a3aba0aed 100644 --- a/examples/qtconcurrent/progressdialog/progressdialog.pro +++ b/examples/qtconcurrent/progressdialog/progressdialog.pro @@ -12,6 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog INSTALLS += target sources -QT += widgets +QT += concurrent widgets simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro index d41b88e2b01..f047577c9f2 100644 --- a/examples/qtconcurrent/runfunction/runfunction.pro +++ b/examples/qtconcurrent/runfunction/runfunction.pro @@ -12,6 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction INSTALLS += target sources -QT += widgets +QT += concurrent widgets simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro index ee4887c0f13..3bddf1a8627 100644 --- a/examples/qtconcurrent/wordcount/wordcount.pro +++ b/examples/qtconcurrent/wordcount/wordcount.pro @@ -12,6 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount INSTALLS += target sources -QT += widgets +QT += concurrent widgets simulator: warning(This example does not work on Simulator platform) diff --git a/examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp b/examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp index fb8f55db94d..02aed98c1dc 100644 --- a/examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp +++ b/examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp @@ -39,6 +39,8 @@ ****************************************************************************/ #include <QtCore> +#include <QtConcurrent> + /* says hello from main thread and secondary thread using QtConcurrent */ diff --git a/examples/tutorials/threads/helloconcurrent/helloconcurrent.pro b/examples/tutorials/threads/helloconcurrent/helloconcurrent.pro index fb3cd0b3947..19416667556 100644 --- a/examples/tutorials/threads/helloconcurrent/helloconcurrent.pro +++ b/examples/tutorials/threads/helloconcurrent/helloconcurrent.pro @@ -1,4 +1,5 @@ QT -= gui +QT += concurrent CONFIG += console CONFIG -= app_bundle diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro new file mode 100644 index 00000000000..a9482af0572 --- /dev/null +++ b/src/concurrent/concurrent.pro @@ -0,0 +1,59 @@ +TARGET = QtConcurrent +QPRO_PWD = $$PWD +QT = core-private + +CONFIG += module +MODULE_PRI = ../modules/qt_concurrent.pri + +DEFINES += QT_BUILD_CONCURRENT_LIB QT_NO_USING_NAMESPACE +win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 + +unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore + +load(qt_module_config) + +HEADERS += $$QT_SOURCE_TREE/src/xml/qtconcurrentversion.h + +PRECOMPILED_HEADER = ../corelib/global/qt_pch.h + +SOURCES += \ + qfuture.cpp \ + qfutureinterface.cpp \ + qfuturesynchronizer.cpp \ + qfuturewatcher.cpp \ + qtconcurrentfilter.cpp \ + qtconcurrentmap.cpp \ + qtconcurrentresultstore.cpp \ + qtconcurrentthreadengine.cpp \ + qtconcurrentiteratekernel.cpp \ + qtconcurrentexception.cpp + +HEADERS += \ + qfuture.h \ + qfutureinterface.h \ + qfuturesynchronizer.h \ + qfuturewatcher.h \ + qtconcurrentcompilertest.h \ + qtconcurrentexception.h \ + qtconcurrentfilter.h \ + qtconcurrentfilterkernel.h \ + qtconcurrentfunctionwrappers.h \ + qtconcurrentiteratekernel.h \ + qtconcurrentmap.h \ + qtconcurrentmapkernel.h \ + qtconcurrentmedian.h \ + qtconcurrentreducekernel.h \ + qtconcurrentresultstore.h \ + qtconcurrentrun.h \ + qtconcurrentrunbase.h \ + qtconcurrentstoredfunctioncall.h \ + qtconcurrentthreadengine.h + +# private headers +HEADERS += \ + qfutureinterface_p.h \ + qfuturewatcher_p.h + +contains(QT_CONFIG, clock-gettime) { + linux-*|hpux-*|solaris-*:LIBS *= -lrt +} diff --git a/src/corelib/concurrent/qfuture.cpp b/src/concurrent/qfuture.cpp index 9805454cb28..9805454cb28 100644 --- a/src/corelib/concurrent/qfuture.cpp +++ b/src/concurrent/qfuture.cpp diff --git a/src/corelib/concurrent/qfuture.h b/src/concurrent/qfuture.h index a22168aaba6..6e99a6068e2 100644 --- a/src/corelib/concurrent/qfuture.h +++ b/src/concurrent/qfuture.h @@ -46,9 +46,9 @@ #ifndef QT_NO_QFUTURE -#include <QtCore/qfutureinterface.h> +#include <QtConcurrent/qfutureinterface.h> #include <QtCore/qstring.h> -#include <QtCore/qtconcurrentcompilertest.h> +#include <QtConcurrent/qtconcurrentcompilertest.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qfutureinterface.cpp b/src/concurrent/qfutureinterface.cpp index 9a273a10766..9a273a10766 100644 --- a/src/corelib/concurrent/qfutureinterface.cpp +++ b/src/concurrent/qfutureinterface.cpp diff --git a/src/corelib/concurrent/qfutureinterface.h b/src/concurrent/qfutureinterface.h index 85272bc565b..f64623ae587 100644 --- a/src/corelib/concurrent/qfutureinterface.h +++ b/src/concurrent/qfutureinterface.h @@ -48,8 +48,8 @@ #ifndef QT_NO_QFUTURE #include <QtCore/qmutex.h> -#include <QtCore/qtconcurrentexception.h> -#include <QtCore/qtconcurrentresultstore.h> +#include <QtConcurrent/qtconcurrentexception.h> +#include <QtConcurrent/qtconcurrentresultstore.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qfutureinterface_p.h b/src/concurrent/qfutureinterface_p.h index ea52621378a..ea52621378a 100644 --- a/src/corelib/concurrent/qfutureinterface_p.h +++ b/src/concurrent/qfutureinterface_p.h diff --git a/src/corelib/concurrent/qfuturesynchronizer.cpp b/src/concurrent/qfuturesynchronizer.cpp index 34b00daf4fe..34b00daf4fe 100644 --- a/src/corelib/concurrent/qfuturesynchronizer.cpp +++ b/src/concurrent/qfuturesynchronizer.cpp diff --git a/src/corelib/concurrent/qfuturesynchronizer.h b/src/concurrent/qfuturesynchronizer.h index 1661cae13c6..8b7e710ea93 100644 --- a/src/corelib/concurrent/qfuturesynchronizer.h +++ b/src/concurrent/qfuturesynchronizer.h @@ -42,7 +42,7 @@ #ifndef QFUTRUESYNCHRONIZER_H #define QFUTRUESYNCHRONIZER_H -#include <QtCore/qfuture.h> +#include <QtConcurrent/qfuture.h> #ifndef QT_NO_CONCURRENT diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/concurrent/qfuturewatcher.cpp index d3a1122a07d..d3a1122a07d 100644 --- a/src/corelib/concurrent/qfuturewatcher.cpp +++ b/src/concurrent/qfuturewatcher.cpp diff --git a/src/corelib/concurrent/qfuturewatcher.h b/src/concurrent/qfuturewatcher.h index 6029331ed1a..0e94863d129 100644 --- a/src/corelib/concurrent/qfuturewatcher.h +++ b/src/concurrent/qfuturewatcher.h @@ -42,7 +42,7 @@ #ifndef QFUTUREWATCHER_H #define QFUTUREWATCHER_H -#include <QtCore/qfuture.h> +#include <QtConcurrent/qfuture.h> #ifndef QT_NO_QFUTURE diff --git a/src/corelib/concurrent/qfuturewatcher_p.h b/src/concurrent/qfuturewatcher_p.h index 27bc49439ae..27bc49439ae 100644 --- a/src/corelib/concurrent/qfuturewatcher_p.h +++ b/src/concurrent/qfuturewatcher_p.h diff --git a/src/corelib/concurrent/qtconcurrentcompilertest.h b/src/concurrent/qtconcurrentcompilertest.h index 78184230902..78184230902 100644 --- a/src/corelib/concurrent/qtconcurrentcompilertest.h +++ b/src/concurrent/qtconcurrentcompilertest.h diff --git a/src/corelib/concurrent/qtconcurrentexception.cpp b/src/concurrent/qtconcurrentexception.cpp index caeaa8d9be4..caeaa8d9be4 100644 --- a/src/corelib/concurrent/qtconcurrentexception.cpp +++ b/src/concurrent/qtconcurrentexception.cpp diff --git a/src/corelib/concurrent/qtconcurrentexception.h b/src/concurrent/qtconcurrentexception.h index b04e1f2a04a..b04e1f2a04a 100644 --- a/src/corelib/concurrent/qtconcurrentexception.h +++ b/src/concurrent/qtconcurrentexception.h diff --git a/src/corelib/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp index 76ce8ca659d..76ce8ca659d 100644 --- a/src/corelib/concurrent/qtconcurrentfilter.cpp +++ b/src/concurrent/qtconcurrentfilter.cpp diff --git a/src/corelib/concurrent/qtconcurrentfilter.h b/src/concurrent/qtconcurrentfilter.h index f5c38654d39..1de8d230b1d 100644 --- a/src/corelib/concurrent/qtconcurrentfilter.h +++ b/src/concurrent/qtconcurrentfilter.h @@ -46,8 +46,8 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentfilterkernel.h> -#include <QtCore/qtconcurrentfunctionwrappers.h> +#include <QtConcurrent/qtconcurrentfilterkernel.h> +#include <QtConcurrent/qtconcurrentfunctionwrappers.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qtconcurrentfilterkernel.h b/src/concurrent/qtconcurrentfilterkernel.h index ea0e5fcf5d2..71112cb5a34 100644 --- a/src/corelib/concurrent/qtconcurrentfilterkernel.h +++ b/src/concurrent/qtconcurrentfilterkernel.h @@ -46,9 +46,9 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentiteratekernel.h> -#include <QtCore/qtconcurrentmapkernel.h> -#include <QtCore/qtconcurrentreducekernel.h> +#include <QtConcurrent/qtconcurrentiteratekernel.h> +#include <QtConcurrent/qtconcurrentmapkernel.h> +#include <QtConcurrent/qtconcurrentreducekernel.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index 9b86b73f6d3..9b86b73f6d3 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp index b6958051352..b6958051352 100644 --- a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp +++ b/src/concurrent/qtconcurrentiteratekernel.cpp diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 527bd85a228..a28bc31a645 100644 --- a/src/corelib/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -47,8 +47,8 @@ #ifndef QT_NO_CONCURRENT #include <QtCore/qatomic.h> -#include <QtCore/qtconcurrentmedian.h> -#include <QtCore/qtconcurrentthreadengine.h> +#include <QtConcurrent/qtconcurrentmedian.h> +#include <QtConcurrent/qtconcurrentthreadengine.h> #ifndef QT_NO_STL # include <iterator> diff --git a/src/corelib/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index 1758cb9e955..1758cb9e955 100644 --- a/src/corelib/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp diff --git a/src/corelib/concurrent/qtconcurrentmap.h b/src/concurrent/qtconcurrentmap.h index ef66cc1a1af..8a5557183d9 100644 --- a/src/corelib/concurrent/qtconcurrentmap.h +++ b/src/concurrent/qtconcurrentmap.h @@ -46,9 +46,9 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentmapkernel.h> -#include <QtCore/qtconcurrentreducekernel.h> -#include <QtCore/qtconcurrentfunctionwrappers.h> +#include <QtConcurrent/qtconcurrentmapkernel.h> +#include <QtConcurrent/qtconcurrentreducekernel.h> +#include <QtConcurrent/qtconcurrentfunctionwrappers.h> #include <QtCore/qstringlist.h> QT_BEGIN_HEADER diff --git a/src/corelib/concurrent/qtconcurrentmapkernel.h b/src/concurrent/qtconcurrentmapkernel.h index 47cf143fffa..ceeaa6e3b35 100644 --- a/src/corelib/concurrent/qtconcurrentmapkernel.h +++ b/src/concurrent/qtconcurrentmapkernel.h @@ -46,8 +46,8 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentiteratekernel.h> -#include <QtCore/qtconcurrentreducekernel.h> +#include <QtConcurrent/qtconcurrentiteratekernel.h> +#include <QtConcurrent/qtconcurrentreducekernel.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index 78fc3d97c88..78fc3d97c88 100644 --- a/src/corelib/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h diff --git a/src/corelib/concurrent/qtconcurrentreducekernel.h b/src/concurrent/qtconcurrentreducekernel.h index ddf56298adb..ddf56298adb 100644 --- a/src/corelib/concurrent/qtconcurrentreducekernel.h +++ b/src/concurrent/qtconcurrentreducekernel.h diff --git a/src/corelib/concurrent/qtconcurrentresultstore.cpp b/src/concurrent/qtconcurrentresultstore.cpp index 64de8649cee..64de8649cee 100644 --- a/src/corelib/concurrent/qtconcurrentresultstore.cpp +++ b/src/concurrent/qtconcurrentresultstore.cpp diff --git a/src/corelib/concurrent/qtconcurrentresultstore.h b/src/concurrent/qtconcurrentresultstore.h index d39a45bba33..d39a45bba33 100644 --- a/src/corelib/concurrent/qtconcurrentresultstore.h +++ b/src/concurrent/qtconcurrentresultstore.h diff --git a/src/corelib/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index e51626ed138..e51626ed138 100644 --- a/src/corelib/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp diff --git a/src/corelib/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h index fc4bd01eaa4..d7285388da6 100644 --- a/src/corelib/concurrent/qtconcurrentrun.h +++ b/src/concurrent/qtconcurrentrun.h @@ -47,8 +47,8 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentrunbase.h> -#include <QtCore/qtconcurrentstoredfunctioncall.h> +#include <QtConcurrent/qtconcurrentrunbase.h> +#include <QtConcurrent/qtconcurrentstoredfunctioncall.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qtconcurrentrunbase.h b/src/concurrent/qtconcurrentrunbase.h index 99ca0a9699b..2105437edeb 100644 --- a/src/corelib/concurrent/qtconcurrentrunbase.h +++ b/src/concurrent/qtconcurrentrunbase.h @@ -46,7 +46,7 @@ #ifndef QT_NO_CONCURRENT -#include <QtCore/qfuture.h> +#include <QtConcurrent/qfuture.h> #include <QtCore/qrunnable.h> #include <QtCore/qthreadpool.h> diff --git a/src/corelib/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index cf426a42037..c311a72427c 100644 --- a/src/corelib/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -46,7 +46,7 @@ #include <QtCore/qglobal.h> #ifndef QT_NO_CONCURRENT -#include <QtCore/qtconcurrentrunbase.h> +#include <QtConcurrent/qtconcurrentrunbase.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp index 774122674f0..774122674f0 100644 --- a/src/corelib/concurrent/qtconcurrentthreadengine.cpp +++ b/src/concurrent/qtconcurrentthreadengine.cpp diff --git a/src/corelib/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h index e9c144a3c5a..20e86f59b6d 100644 --- a/src/corelib/concurrent/qtconcurrentthreadengine.h +++ b/src/concurrent/qtconcurrentthreadengine.h @@ -47,9 +47,9 @@ #ifndef QT_NO_CONCURRENT #include <QtCore/qthreadpool.h> -#include <QtCore/qfuture.h> +#include <QtConcurrent/qfuture.h> #include <QtCore/qdebug.h> -#include <QtCore/qtconcurrentexception.h> +#include <QtConcurrent/qtconcurrentexception.h> #include <QtCore/qwaitcondition.h> #include <QtCore/qatomic.h> #include <QtCore/qsemaphore.h> diff --git a/src/corelib/concurrent/concurrent.pri b/src/corelib/concurrent/concurrent.pri deleted file mode 100644 index 940297139c8..00000000000 --- a/src/corelib/concurrent/concurrent.pri +++ /dev/null @@ -1,42 +0,0 @@ -SOURCES += \ - concurrent/qfuture.cpp \ - concurrent/qfutureinterface.cpp \ - concurrent/qfuturesynchronizer.cpp \ - concurrent/qfuturewatcher.cpp \ - concurrent/qrunnable.cpp \ - concurrent/qtconcurrentfilter.cpp \ - concurrent/qtconcurrentmap.cpp \ - concurrent/qtconcurrentresultstore.cpp \ - concurrent/qtconcurrentthreadengine.cpp \ - concurrent/qtconcurrentiteratekernel.cpp \ - concurrent/qtconcurrentexception.cpp \ - concurrent/qthreadpool.cpp - -HEADERS += \ - concurrent/qfuture.h \ - concurrent/qfutureinterface.h \ - concurrent/qfuturesynchronizer.h \ - concurrent/qfuturewatcher.h \ - concurrent/qrunnable.h \ - concurrent/qtconcurrentcompilertest.h \ - concurrent/qtconcurrentexception.h \ - concurrent/qtconcurrentfilter.h \ - concurrent/qtconcurrentfilterkernel.h \ - concurrent/qtconcurrentfunctionwrappers.h \ - concurrent/qtconcurrentiteratekernel.h \ - concurrent/qtconcurrentmap.h \ - concurrent/qtconcurrentmapkernel.h \ - concurrent/qtconcurrentmedian.h \ - concurrent/qtconcurrentreducekernel.h \ - concurrent/qtconcurrentresultstore.h \ - concurrent/qtconcurrentrun.h \ - concurrent/qtconcurrentrunbase.h \ - concurrent/qtconcurrentstoredfunctioncall.h \ - concurrent/qtconcurrentthreadengine.h \ - concurrent/qthreadpool.h - -# private headers -HEADERS += \ - concurrent/qfutureinterface_p.h \ - concurrent/qfuturewatcher_p.h \ - concurrent/qthreadpool_p.h diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index de2b1006cf3..c8c9b9b8e6f 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -18,7 +18,6 @@ HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h include(animation/animation.pri) include(arch/arch.pri) -include(concurrent/concurrent.pri) include(global/global.pri) include(thread/thread.pri) include(tools/tools.pri) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 681cd55bb08..c92336f95c8 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1326,6 +1326,11 @@ class QDataStream; # define Q_DBUS_EXPORT Q_DECL_IMPORT # endif # define Q_TEMPLATEDLL +# if defined(QT_BUILD_CONCURRENT_LIB) +# define Q_CONCURRENT_EXPORT Q_DECL_EXPORT +# else +# define Q_CONCURRENT_EXPORT Q_DECL_IMPORT +# endif # elif defined(QT_DLL) /* use a Qt DLL library */ # define Q_CORE_EXPORT Q_DECL_IMPORT # define Q_GUI_EXPORT Q_DECL_IMPORT @@ -1347,6 +1352,7 @@ class QDataStream; # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT # define Q_COMPAT_EXPORT Q_DECL_IMPORT # define Q_DBUS_EXPORT Q_DECL_IMPORT +# define Q_CONCURRENT_EXPORT Q_DECL_IMPORT # define Q_TEMPLATEDLL # endif # define Q_NO_DECLARED_NOT_DEFINED @@ -1380,6 +1386,7 @@ class QDataStream; # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT # define Q_COMPAT_EXPORT Q_DECL_EXPORT # define Q_DBUS_EXPORT Q_DECL_EXPORT +# define Q_CONCURRENT_EXPORT Q_DECL_EXPORT # else # define Q_CORE_EXPORT # define Q_GUI_EXPORT @@ -1400,6 +1407,7 @@ class QDataStream; # define Q_SCRIPTTOOLS_EXPORT # define Q_COMPAT_EXPORT # define Q_DBUS_EXPORT +# define Q_CONCURRENT_EXPORT # endif #endif diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index a248e18a6a3..cf3ae1b7c5f 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -593,7 +593,6 @@ QCoreApplication::~QCoreApplication() QCoreApplicationPrivate::is_app_running = false; #if !defined(QT_NO_THREAD) -#if !defined(QT_NO_CONCURRENT) // Synchronize and stop the global thread pool threads. QThreadPool *globalThreadPool = 0; QT_TRY { @@ -603,7 +602,6 @@ QCoreApplication::~QCoreApplication() } if (globalThreadPool) globalThreadPool->waitForDone(); -#endif QThread::cleanup(); #endif diff --git a/src/corelib/concurrent/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp index 933a5b922cd..933a5b922cd 100644 --- a/src/corelib/concurrent/qrunnable.cpp +++ b/src/corelib/thread/qrunnable.cpp diff --git a/src/corelib/concurrent/qrunnable.h b/src/corelib/thread/qrunnable.h index 11d5c0146e2..11d5c0146e2 100644 --- a/src/corelib/concurrent/qrunnable.h +++ b/src/corelib/thread/qrunnable.h diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index af8c99197ec..af8c99197ec 100644 --- a/src/corelib/concurrent/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp diff --git a/src/corelib/concurrent/qthreadpool.h b/src/corelib/thread/qthreadpool.h index 9fc023c56dc..9fc023c56dc 100644 --- a/src/corelib/concurrent/qthreadpool.h +++ b/src/corelib/thread/qthreadpool.h diff --git a/src/corelib/concurrent/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h index f4c67b81a77..9a7c09695f0 100644 --- a/src/corelib/concurrent/qthreadpool_p.h +++ b/src/corelib/thread/qthreadpool_p.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class QThreadPoolThread; -class QThreadPoolPrivate : public QObjectPrivate +class Q_CORE_EXPORT QThreadPoolPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QThreadPool) friend class QThreadPoolThread; diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri index ea6f0eb91e4..1eefa60d500 100644 --- a/src/corelib/thread/thread.pri +++ b/src/corelib/thread/thread.pri @@ -2,9 +2,11 @@ # public headers HEADERS += thread/qmutex.h \ + thread/qrunnable.h \ thread/qreadwritelock.h \ thread/qsemaphore.h \ thread/qthread.h \ + thread/qthreadpool.h \ thread/qthreadstorage.h \ thread/qwaitcondition.h \ thread/qatomic.h \ @@ -17,14 +19,17 @@ HEADERS += thread/qmutex_p.h \ thread/qmutexpool_p.h \ thread/qorderedmutexlocker_p.h \ thread/qreadwritelock_p.h \ - thread/qthread_p.h + thread/qthread_p.h \ + thread/qthreadpool_p.h SOURCES += thread/qatomic.cpp \ thread/qmutex.cpp \ thread/qreadwritelock.cpp \ + thread/qrunnable.cpp \ thread/qmutexpool.cpp \ thread/qsemaphore.cpp \ thread/qthread.cpp \ + thread/qthreadpool.cpp \ thread/qthreadstorage.cpp unix:SOURCES += thread/qthread_unix.cpp \ diff --git a/src/modules/qt_concurrent.pri b/src/modules/qt_concurrent.pri new file mode 100644 index 00000000000..eccec12f664 --- /dev/null +++ b/src/modules/qt_concurrent.pri @@ -0,0 +1,15 @@ +QT.concurrent.VERSION = 5.0.0 +QT.concurrent.MAJOR_VERSION = 5 +QT.concurrent.MINOR_VERSION = 0 +QT.concurrent.PATCH_VERSION = 0 + +QT.concurrent.name = QtConcurrent +QT.concurrent.bins = $$QT_MODULE_BIN_BASE +QT.concurrent.includes = $$QT_MODULE_INCLUDE_BASE/QtConcurrent +QT.concurrent.private_includes = $$QT_MODULE_INCLUDE_BASE/QtConcurrent/$$QT.concurrent.VERSION +QT.concurrent.sources = $$QT_MODULE_BASE/src/concurrent +QT.concurrent.libs = $$QT_MODULE_LIB_BASE +QT.concurrent.plugins = $$QT_MODULE_PLUGIN_BASE +QT.concurrent.imports = $$QT_MODULE_IMPORT_BASE +QT.concurrent.depends = core +QT.concurrent.DEFINES = QT_CONCURRENT_LIB diff --git a/src/src.pro b/src/src.pro index 8d750bab767..9ef8bf43628 100644 --- a/src/src.pro +++ b/src/src.pro @@ -8,6 +8,7 @@ SRC_SUBDIRS += src_corelib SRC_SUBDIRS += src_network src_sql src_gui src_xml src_widgets src_printsupport src_testlib src_platformsupport nacl: SRC_SUBDIRS -= src_network src_testlib contains(QT_CONFIG, dbus):SRC_SUBDIRS += src_dbus +contains(QT_CONFIG, concurrent):SRC_SUBDIRS += src_concurrent contains(QT_CONFIG, no-gui): SRC_SUBDIRS -= src_gui @@ -40,6 +41,8 @@ src_testlib.subdir = $$QT_SOURCE_TREE/src/testlib src_testlib.target = sub-testlib src_platformsupport.subdir = $$QT_SOURCE_TREE/src/platformsupport src_platformsupport.target = sub-platformsupport +src_concurrent.subdir = $$QT_SOURCE_TREE/src/concurrent +src_concurrent.target = sub-concurrent #CONFIG += ordered @@ -50,6 +53,7 @@ src_platformsupport.target = sub-platformsupport src_platformsupport.depends = src_corelib src_gui src_network src_widgets.depends = src_corelib src_gui src_tools_uic src_xml.depends = src_corelib + src_concurrent.depends = src_corelib src_dbus.depends = src_corelib src_network.depends = src_corelib src_opengl.depends = src_gui src_widgets diff --git a/sync.profile b/sync.profile index cabc8a3ab54..446f8f40fa2 100644 --- a/sync.profile +++ b/sync.profile @@ -9,6 +9,7 @@ "QtNetwork" => "$basedir/src/network", "QtTest" => "$basedir/src/testlib", "QtDBus" => "$basedir/src/dbus", + "QtConcurrent" => "$basedir/src/concurrent", "QtPlatformSupport" => "$basedir/src/platformsupport", ); %moduleheaders = ( # restrict the module headers to those found in relative path @@ -40,6 +41,7 @@ "qtxmlversion.h" => "QtXmlVersion", "qtwidgetsversion.h" => "QtWidgetsVersion", "qtprintsupportversion.h" => "QtPrintSupportVersion", + "qtconcurrentversion.h" => "QtConcurrentVersion", "qtplatformsupportversion.h" => "QtPlatformSupportVersion", ); %mastercontent = ( @@ -50,6 +52,7 @@ "network" => "#include <QtNetwork/QtNetwork>\n", "opengl" => "#include <QtOpenGL/QtOpenGL>\n", "xml" => "#include <QtXml/QtXml>\n", + "concurrent" => "#include <QtConcurrent/QtConcurrent>\n", ); %modulepris = ( "QtCore" => "$basedir/src/modules/qt_core.pri", @@ -62,6 +65,7 @@ "QtSql" => "$basedir/src/modules/qt_sql.pri", "QtTest" => "$basedir/src/modules/qt_testlib.pri", "QtXml" => "$basedir/src/modules/qt_xml.pri", + "QtConcurrent" => "$basedir/src/modules/qt_concurrent.pri", "QtPlatformSupport" => "$basedir/src/modules/qt_platformsupport.pri", ); %explicitheaders = ( diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 4f81c435534..1796fa2db92 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -10,6 +10,7 @@ SUBDIRS += \ testlib \ tools \ xml \ + concurrent \ other \ widgets \ @@ -21,3 +22,6 @@ cross_compile: SUBDIRS -= tools mac { network.CONFIG += no_check_target } + +!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent + diff --git a/tests/auto/corelib/concurrent/concurrent.pro b/tests/auto/concurrent/concurrent.pro index 6541b0ce42f..15368aef641 100644 --- a/tests/auto/corelib/concurrent/concurrent.pro +++ b/tests/auto/concurrent/concurrent.pro @@ -8,6 +8,5 @@ SUBDIRS=\ qtconcurrentmap \ qtconcurrentresultstore \ qtconcurrentrun \ - qtconcurrentthreadengine \ - qthreadpool + qtconcurrentthreadengine diff --git a/tests/auto/corelib/concurrent/qfuture/.gitignore b/tests/auto/concurrent/qfuture/.gitignore index 77c055c8749..77c055c8749 100644 --- a/tests/auto/corelib/concurrent/qfuture/.gitignore +++ b/tests/auto/concurrent/qfuture/.gitignore diff --git a/tests/auto/corelib/concurrent/qfuture/qfuture.pro b/tests/auto/concurrent/qfuture/qfuture.pro index 517871ab5d2..a4c706129d9 100644 --- a/tests/auto/corelib/concurrent/qfuture/qfuture.pro +++ b/tests/auto/concurrent/qfuture/qfuture.pro @@ -1,5 +1,5 @@ CONFIG += testcase parallel_test TARGET = tst_qfuture -QT = core-private testlib +QT = concurrent-private testlib concurrent SOURCES = tst_qfuture.cpp DEFINES += QT_STRICT_ITERATORS diff --git a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp b/tests/auto/concurrent/qfuture/tst_qfuture.cpp index 3610f8f2d41..3610f8f2d41 100644 --- a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp +++ b/tests/auto/concurrent/qfuture/tst_qfuture.cpp diff --git a/tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro b/tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro index b36560b4baf..331a8e3c050 100644 --- a/tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro +++ b/tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qfuturesynchronizer -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qfuturesynchronizer.cpp diff --git a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp b/tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp index 5bf6d1d1f39..012c90de182 100644 --- a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp +++ b/tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp @@ -41,8 +41,8 @@ #include <QtTest> -#include <QtCore/qfuturesynchronizer.h> -#include <QtCore/qfuture.h> +#include <QtConcurrent/qfuturesynchronizer.h> +#include <QtConcurrent/qfuture.h> class tst_QFutureSynchronizer : public QObject { diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/.gitignore b/tests/auto/concurrent/qfuturewatcher/.gitignore index 1d778431c5c..1d778431c5c 100644 --- a/tests/auto/corelib/concurrent/qfuturewatcher/.gitignore +++ b/tests/auto/concurrent/qfuturewatcher/.gitignore diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro index ae98fed3d90..3b8ebda4a4f 100644 --- a/tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro +++ b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qfuturewatcher -QT = core-private testlib +QT = concurrent-private testlib concurrent SOURCES = tst_qfuturewatcher.cpp diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp index 5a86d97d4e7..fe3eb378d51 100644 --- a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp +++ b/tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp @@ -42,10 +42,7 @@ #include <QDebug> #include <QtTest/QtTest> -#include <qfuture.h> -#include <qfuturewatcher.h> -#include <qtconcurrentrun.h> -#include <qtconcurrentmap.h> +#include <QtConcurrent> #include <private/qfutureinterface_p.h> using namespace QtConcurrent; diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore b/tests/auto/concurrent/qtconcurrentfilter/.gitignore index f93d27e009b..f93d27e009b 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore +++ b/tests/auto/concurrent/qtconcurrentfilter/.gitignore diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro index f783455b2e4..eb0c054f6f6 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro +++ b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro @@ -1,6 +1,6 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentfilter -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qtconcurrentfilter.cpp DEFINES += QT_STRICT_ITERATORS diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp index 971a6992ffe..971a6992ffe 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp +++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore b/tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore index ac5dec4db69..ac5dec4db69 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro index e876c86725c..4cfebc0e3d0 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentiteratekernel -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qtconcurrentiteratekernel.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index 46562b5eb02..46562b5eb02 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore b/tests/auto/concurrent/qtconcurrentmap/.gitignore index f1c563e9793..f1c563e9793 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore +++ b/tests/auto/concurrent/qtconcurrentmap/.gitignore diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h b/tests/auto/concurrent/qtconcurrentmap/functions.h index f5963db9047..f5963db9047 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h +++ b/tests/auto/concurrent/qtconcurrentmap/functions.h diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro index b4f5cbc565d..199e5ad4d65 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro +++ b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro @@ -1,5 +1,5 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentmap -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qtconcurrentmap.cpp DEFINES += QT_STRICT_ITERATORS diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp index 960511d87b8..960511d87b8 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro b/tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro index e93fc587a73..2c04f750250 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro +++ b/tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro @@ -1,5 +1,5 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentresultstore -QT = core-private testlib +QT = core-private testlib concurrent SOURCES = tst_qtconcurrentresultstore.cpp DEFINES += QT_STRICT_ITERATORS diff --git a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp b/tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp index 236d0b62e36..236d0b62e36 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp +++ b/tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore b/tests/auto/concurrent/qtconcurrentrun/.gitignore index d7a8334ec47..d7a8334ec47 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore +++ b/tests/auto/concurrent/qtconcurrentrun/.gitignore diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro index d4f130fecde..03d77b33a21 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro +++ b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentrun -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qtconcurrentrun.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp index 86e3433c128..86e3433c128 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp +++ b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore b/tests/auto/concurrent/qtconcurrentthreadengine/.gitignore index a2e2896246c..a2e2896246c 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore +++ b/tests/auto/concurrent/qtconcurrentthreadengine/.gitignore diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro index 536ccc3ea5c..f6ddd33504d 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro +++ b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qtconcurrentthreadengine -QT = core testlib +QT = core testlib concurrent SOURCES = tst_qtconcurrentthreadengine.cpp diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp index 9722887c7db..9722887c7db 100644 --- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp +++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index ade17863d90..7daed397d52 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -47,7 +47,6 @@ #include <qtextdocument.h> #include <time.h> #include <qprocess.h> -#include <QtConcurrentMap> #include <QThreadPool> class tst_QTextCodec : public QObject @@ -55,9 +54,7 @@ class tst_QTextCodec : public QObject Q_OBJECT private slots: -#ifndef QT_NO_CONCURRENT void threadSafety(); -#endif void toUnicode_data(); void toUnicode(); @@ -1939,48 +1936,75 @@ void tst_QTextCodec::toLocal8Bit() } #endif -static QByteArray loadAndConvert(const QByteArray &codecName) +class LoadAndConvert: public QRunnable { - QTextCodec *c = QTextCodec::codecForName(codecName); - if (!c) { - qWarning() << "WARNING" << codecName << "not found?"; - return QByteArray(); +public: + LoadAndConvert(const QByteArray &source, QByteArray *destination) + : codecName(source), target(destination) + {} + QByteArray codecName; + QByteArray *target; + void run() + { + QTextCodec *c = QTextCodec::codecForName(codecName); + if (!c) { + qWarning() << "WARNING" << codecName << "not found?"; + return; + } + QString str = QString::fromLatin1(codecName); + QByteArray b = c->fromUnicode(str); + c->toUnicode(b); + *target = codecName; } - QString str = QString::fromLatin1(codecName); - QByteArray b = c->fromUnicode(str); - c->toUnicode(b); - return codecName; -} +}; -static int loadAndConvertMIB(int mib) +class LoadAndConvertMIB: public QRunnable { - QTextCodec *c = QTextCodec::codecForMib(mib); - if (!c) { - qWarning() << "WARNING" << mib << "not found?"; - return 0; +public: + LoadAndConvertMIB(int mib, int *target) + : mib(mib), target(target) + {} + int mib; + int *target; + void run() + { + QTextCodec *c = QTextCodec::codecForMib(mib); + if (!c) { + qWarning() << "WARNING" << mib << "not found?"; + return; + } + QString str = QString::number(mib); + QByteArray b = c->fromUnicode(str); + c->toUnicode(b); + *target = mib; } - QString str = QString::number(mib); - QByteArray b = c->fromUnicode(str); - c->toUnicode(b); - return mib; -} +}; -#ifndef QT_NO_CONCURRENT void tst_QTextCodec::threadSafety() { QList<QByteArray> codecList = QTextCodec::availableCodecs(); QList<int> mibList = QTextCodec::availableMibs(); QThreadPool::globalInstance()->setMaxThreadCount(12); - QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert); + QVector<QByteArray> res; + res.resize(codecList.size()); + for (int i = 0; i < codecList.size(); ++i) { + QThreadPool::globalInstance()->start(new LoadAndConvert(codecList.at(i), &res[i])); + } - QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB); + QVector<int> res2; + res2.resize(mibList.size()); + for (int i = 0; i < mibList.size(); ++i) { + QThreadPool::globalInstance()->start(new LoadAndConvertMIB(mibList.at(i), &res2[i])); + } + + // wait for all threads to finish working + QThreadPool::globalInstance()->waitForDone(); - QCOMPARE(res.results(), codecList); - QCOMPARE(res2.results(), mibList); + QCOMPARE(res.toList(), codecList); + QCOMPARE(res2.toList(), mibList); } -#endif void tst_QTextCodec::invalidNames() { diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro index be12fdab629..4f284ac21e2 100644 --- a/tests/auto/corelib/corelib.pro +++ b/tests/auto/corelib/corelib.pro @@ -2,7 +2,6 @@ TEMPLATE=subdirs SUBDIRS=\ animation \ codecs \ - concurrent \ global \ io \ itemmodels \ @@ -14,4 +13,3 @@ SUBDIRS=\ tools \ xml -!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent diff --git a/tests/auto/corelib/concurrent/qthreadpool/.gitignore b/tests/auto/corelib/thread/qthreadpool/.gitignore index 16105821a22..16105821a22 100644 --- a/tests/auto/corelib/concurrent/qthreadpool/.gitignore +++ b/tests/auto/corelib/thread/qthreadpool/.gitignore diff --git a/tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro index 4d81218f243..4d81218f243 100644 --- a/tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro +++ b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro diff --git a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 1dd0410f411..1dd0410f411 100644 --- a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp diff --git a/tests/auto/corelib/thread/thread.pro b/tests/auto/corelib/thread/thread.pro index a137748b75a..12a284c7c7f 100644 --- a/tests/auto/corelib/thread/thread.pro +++ b/tests/auto/corelib/thread/thread.pro @@ -9,6 +9,7 @@ SUBDIRS=\ qsemaphore \ qthread \ qthreadonce \ + qthreadpool \ qthreadstorage \ qwaitcondition \ qwritelocker |