diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-02-03 14:17:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-05 17:49:16 +0100 |
commit | 96501b0a18f4f70048403dccc4cb42dd71db8f9d (patch) | |
tree | ec4b95139854d1116ad75467c3c08df39fafeb27 | |
parent | c8156cab81690526adffa22214657fc1c6563b8b (diff) | |
download | qtbase-96501b0a18f4f70048403dccc4cb42dd71db8f9d.tar.gz |
Move QtConcurrent into its own module
Task-number: QTBUG-20892
Change-Id: I614500aafb6428915509983608bbb0ade4e4f016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-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 3516168dc2..2c92f727b7 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 204a297ef3..1f68a3838a 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 2ec5abddf6..b268aa75f2 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 f7a359c2af..9fef7d3100 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 978eae44b9..72f770755f 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 b26824c172..87ea4f5486 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 fbc239d199..75a3aba0ae 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 d41b88e2b0..f047577c9f 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 ee4887c0f1..3bddf1a862 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 fb8f55db94..02aed98c1d 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 fb3cd0b394..1941666755 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 0000000000..a9482af057 --- /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 9805454cb2..9805454cb2 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 a22168aaba..6e99a6068e 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 9a273a1076..9a273a1076 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 85272bc565..f64623ae58 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 ea52621378..ea52621378 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 34b00daf4f..34b00daf4f 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 1661cae13c..8b7e710ea9 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 d3a1122a07..d3a1122a07 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 6029331ed1..0e94863d12 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 27bc49439a..27bc49439a 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 7818423090..7818423090 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 caeaa8d9be..caeaa8d9be 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 b04e1f2a04..b04e1f2a04 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 76ce8ca659..76ce8ca659 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 f5c38654d3..1de8d230b1 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 ea0e5fcf5d..71112cb5a3 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 9b86b73f6d..9b86b73f6d 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 b695805135..b695805135 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 527bd85a22..a28bc31a64 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 1758cb9e95..1758cb9e95 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 ef66cc1a1a..8a5557183d 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 47cf143fff..ceeaa6e3b3 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 78fc3d97c8..78fc3d97c8 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 ddf56298ad..ddf56298ad 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 64de8649ce..64de8649ce 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 d39a45bba3..d39a45bba3 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 e51626ed13..e51626ed13 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 fc4bd01eaa..d7285388da 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 99ca0a9699..2105437ede 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 cf426a4203..c311a72427 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 774122674f..774122674f 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 e9c144a3c5..20e86f59b6 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 940297139c..0000000000 --- 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 de2b1006cf..c8c9b9b8e6 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 681cd55bb0..c92336f95c 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 a248e18a6a..cf3ae1b7c5 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 933a5b922c..933a5b922c 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 11d5c0146e..11d5c0146e 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 af8c99197e..af8c99197e 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 9fc023c56d..9fc023c56d 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 f4c67b81a7..9a7c09695f 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 ea6f0eb91e..1eefa60d50 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 0000000000..eccec12f66 --- /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 8d750bab76..9ef8bf4362 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 cabc8a3ab5..446f8f40fa 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 4f81c43553..1796fa2db9 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 6541b0ce42..15368aef64 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 77c055c874..77c055c874 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 517871ab5d..a4c706129d 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 3610f8f2d4..3610f8f2d4 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 b36560b4ba..331a8e3c05 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 5bf6d1d1f3..012c90de18 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 1d778431c5..1d778431c5 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 ae98fed3d9..3b8ebda4a4 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 5a86d97d4e..fe3eb378d5 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 f93d27e009..f93d27e009 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 f783455b2e..eb0c054f6f 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 971a6992ff..971a6992ff 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 ac5dec4db6..ac5dec4db6 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 e876c86725..4cfebc0e3d 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 46562b5eb0..46562b5eb0 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 f1c563e979..f1c563e979 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 f5963db904..f5963db904 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 b4f5cbc565..199e5ad4d6 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 960511d87b..960511d87b 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 e93fc587a7..2c04f75025 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 236d0b62e3..236d0b62e3 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 d7a8334ec4..d7a8334ec4 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 d4f130fecd..03d77b33a2 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 86e3433c12..86e3433c12 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 a2e2896246..a2e2896246 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 536ccc3ea5..f6ddd33504 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 9722887c7d..9722887c7d 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 ade17863d9..7daed397d5 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 be12fdab62..4f284ac21e 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 16105821a2..16105821a2 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 4d81218f24..4d81218f24 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 1dd0410f41..1dd0410f41 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 a137748b75..12a284c7c7 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 |