Move QtConcurrent into its own module
authorLars Knoll <lars.knoll@nokia.com>
Fri, 3 Feb 2012 13:17:26 +0000 (14:17 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sun, 5 Feb 2012 16:49:16 +0000 (17:49 +0100)
Task-number: QTBUG-20892

Change-Id: I614500aafb6428915509983608bbb0ade4e4f016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
91 files changed:
bin/fixqt4headers.pl
examples/qtconcurrent/imagescaling/imagescaling.h
examples/qtconcurrent/imagescaling/imagescaling.pro
examples/qtconcurrent/imagescaling/main.cpp
examples/qtconcurrent/map/map.pro
examples/qtconcurrent/progressdialog/main.cpp
examples/qtconcurrent/progressdialog/progressdialog.pro
examples/qtconcurrent/runfunction/runfunction.pro
examples/qtconcurrent/wordcount/wordcount.pro
examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp
examples/tutorials/threads/helloconcurrent/helloconcurrent.pro
src/concurrent/concurrent.pro [new file with mode: 0644]
src/concurrent/qfuture.cpp [moved from src/corelib/concurrent/qfuture.cpp with 100% similarity]
src/concurrent/qfuture.h [moved from src/corelib/concurrent/qfuture.h with 98% similarity]
src/concurrent/qfutureinterface.cpp [moved from src/corelib/concurrent/qfutureinterface.cpp with 100% similarity]
src/concurrent/qfutureinterface.h [moved from src/corelib/concurrent/qfutureinterface.h with 98% similarity]
src/concurrent/qfutureinterface_p.h [moved from src/corelib/concurrent/qfutureinterface_p.h with 100% similarity]
src/concurrent/qfuturesynchronizer.cpp [moved from src/corelib/concurrent/qfuturesynchronizer.cpp with 100% similarity]
src/concurrent/qfuturesynchronizer.h [moved from src/corelib/concurrent/qfuturesynchronizer.h with 98% similarity]
src/concurrent/qfuturewatcher.cpp [moved from src/corelib/concurrent/qfuturewatcher.cpp with 100% similarity]
src/concurrent/qfuturewatcher.h [moved from src/corelib/concurrent/qfuturewatcher.h with 99% similarity]
src/concurrent/qfuturewatcher_p.h [moved from src/corelib/concurrent/qfuturewatcher_p.h with 100% similarity]
src/concurrent/qtconcurrentcompilertest.h [moved from src/corelib/concurrent/qtconcurrentcompilertest.h with 100% similarity]
src/concurrent/qtconcurrentexception.cpp [moved from src/corelib/concurrent/qtconcurrentexception.cpp with 100% similarity]
src/concurrent/qtconcurrentexception.h [moved from src/corelib/concurrent/qtconcurrentexception.h with 100% similarity]
src/concurrent/qtconcurrentfilter.cpp [moved from src/corelib/concurrent/qtconcurrentfilter.cpp with 100% similarity]
src/concurrent/qtconcurrentfilter.h [moved from src/corelib/concurrent/qtconcurrentfilter.h with 99% similarity]
src/concurrent/qtconcurrentfilterkernel.h [moved from src/corelib/concurrent/qtconcurrentfilterkernel.h with 98% similarity]
src/concurrent/qtconcurrentfunctionwrappers.h [moved from src/corelib/concurrent/qtconcurrentfunctionwrappers.h with 100% similarity]
src/concurrent/qtconcurrentiteratekernel.cpp [moved from src/corelib/concurrent/qtconcurrentiteratekernel.cpp with 100% similarity]
src/concurrent/qtconcurrentiteratekernel.h [moved from src/corelib/concurrent/qtconcurrentiteratekernel.h with 99% similarity]
src/concurrent/qtconcurrentmap.cpp [moved from src/corelib/concurrent/qtconcurrentmap.cpp with 100% similarity]
src/concurrent/qtconcurrentmap.h [moved from src/corelib/concurrent/qtconcurrentmap.h with 98% similarity]
src/concurrent/qtconcurrentmapkernel.h [moved from src/corelib/concurrent/qtconcurrentmapkernel.h with 98% similarity]
src/concurrent/qtconcurrentmedian.h [moved from src/corelib/concurrent/qtconcurrentmedian.h with 100% similarity]
src/concurrent/qtconcurrentreducekernel.h [moved from src/corelib/concurrent/qtconcurrentreducekernel.h with 100% similarity]
src/concurrent/qtconcurrentresultstore.cpp [moved from src/corelib/concurrent/qtconcurrentresultstore.cpp with 100% similarity]
src/concurrent/qtconcurrentresultstore.h [moved from src/corelib/concurrent/qtconcurrentresultstore.h with 100% similarity]
src/concurrent/qtconcurrentrun.cpp [moved from src/corelib/concurrent/qtconcurrentrun.cpp with 100% similarity]
src/concurrent/qtconcurrentrun.h [moved from src/corelib/concurrent/qtconcurrentrun.h with 99% similarity]
src/concurrent/qtconcurrentrunbase.h [moved from src/corelib/concurrent/qtconcurrentrunbase.h with 99% similarity]
src/concurrent/qtconcurrentstoredfunctioncall.h [moved from src/corelib/concurrent/qtconcurrentstoredfunctioncall.h with 99% similarity]
src/concurrent/qtconcurrentthreadengine.cpp [moved from src/corelib/concurrent/qtconcurrentthreadengine.cpp with 100% similarity]
src/concurrent/qtconcurrentthreadengine.h [moved from src/corelib/concurrent/qtconcurrentthreadengine.h with 99% similarity]
src/corelib/concurrent/concurrent.pri [deleted file]
src/corelib/corelib.pro
src/corelib/global/qglobal.h
src/corelib/kernel/qcoreapplication.cpp
src/corelib/thread/qrunnable.cpp [moved from src/corelib/concurrent/qrunnable.cpp with 100% similarity]
src/corelib/thread/qrunnable.h [moved from src/corelib/concurrent/qrunnable.h with 100% similarity]
src/corelib/thread/qthreadpool.cpp [moved from src/corelib/concurrent/qthreadpool.cpp with 100% similarity]
src/corelib/thread/qthreadpool.h [moved from src/corelib/concurrent/qthreadpool.h with 100% similarity]
src/corelib/thread/qthreadpool_p.h [moved from src/corelib/concurrent/qthreadpool_p.h with 98% similarity]
src/corelib/thread/thread.pri
src/modules/qt_concurrent.pri [new file with mode: 0644]
src/src.pro
sync.profile
tests/auto/auto.pro
tests/auto/concurrent/concurrent.pro [moved from tests/auto/corelib/concurrent/concurrent.pro with 82% similarity]
tests/auto/concurrent/qfuture/.gitignore [moved from tests/auto/corelib/concurrent/qfuture/.gitignore with 100% similarity]
tests/auto/concurrent/qfuture/qfuture.pro [moved from tests/auto/corelib/concurrent/qfuture/qfuture.pro with 72% similarity]
tests/auto/concurrent/qfuture/tst_qfuture.cpp [moved from tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp with 100% similarity]
tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro [moved from tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro with 78% similarity]
tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp [moved from tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp with 98% similarity]
tests/auto/concurrent/qfuturewatcher/.gitignore [moved from tests/auto/corelib/concurrent/qfuturewatcher/.gitignore with 100% similarity]
tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro [moved from tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro with 68% similarity]
tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp [moved from tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp with 99% similarity]
tests/auto/concurrent/qtconcurrentfilter/.gitignore [moved from tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore with 100% similarity]
tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro [moved from tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro with 86% similarity]
tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp with 100% similarity]
tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore [moved from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore with 100% similarity]
tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro [moved from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro with 80% similarity]
tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp with 100% similarity]
tests/auto/concurrent/qtconcurrentmap/.gitignore [moved from tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore with 100% similarity]
tests/auto/concurrent/qtconcurrentmap/functions.h [moved from tests/auto/corelib/concurrent/qtconcurrentmap/functions.h with 100% similarity]
tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro [moved from tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro with 81% similarity]
tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp with 100% similarity]
tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro [moved from tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro with 79% similarity]
tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp with 100% similarity]
tests/auto/concurrent/qtconcurrentrun/.gitignore [moved from tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore with 100% similarity]
tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro [moved from tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro with 76% similarity]
tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp with 100% similarity]
tests/auto/concurrent/qtconcurrentthreadengine/.gitignore [moved from tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore with 100% similarity]
tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro [moved from tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro with 79% similarity]
tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp [moved from tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp with 100% similarity]
tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
tests/auto/corelib/corelib.pro
tests/auto/corelib/thread/qthreadpool/.gitignore [moved from tests/auto/corelib/concurrent/qthreadpool/.gitignore with 100% similarity]
tests/auto/corelib/thread/qthreadpool/qthreadpool.pro [moved from tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro with 100% similarity]
tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp [moved from tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp with 100% similarity]
tests/auto/corelib/thread/thread.pro

index 3516168..2c92f72 100755 (executable)
@@ -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);
 
index 204a297..1f68a38 100644 (file)
@@ -41,6 +41,7 @@
 #define IMAGESCALING_H
 
 #include <QtWidgets>
+#include <QtConcurrent>
 
 #ifndef QT_NO_CONCURRENT
 
index 2ec5abd..b268aa7 100644 (file)
@@ -1,6 +1,7 @@
 TEMPLATE = app
 DEPENDPATH += .
 INCLUDEPATH += .
+QT += concurrent
 
 # Input
 SOURCES += main.cpp imagescaling.cpp
index f7a359c..9fef7d3 100644 (file)
@@ -38,6 +38,7 @@
 **
 ****************************************************************************/
 #include <QtWidgets>
+#include <QtConcurrent>
 
 #ifndef QT_NO_CONCURRENT
 
index 978eae4..72f7707 100644 (file)
@@ -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)
index b26824c..87ea4f5 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 #include <QtWidgets>
+#include <QtConcurrent>
 
 #ifndef QT_NO_CONCURRENT
 
index fbc239d..75a3aba 100644 (file)
@@ -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)
index d41b88e..f047577 100644 (file)
@@ -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)
index ee4887c..3bddf1a 100644 (file)
@@ -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)
index fb8f55d..02aed98 100644 (file)
@@ -39,6 +39,8 @@
 ****************************************************************************/
 
 #include <QtCore>
+#include <QtConcurrent>
+
 /*
  says hello from main thread and secondary thread using QtConcurrent
 */
diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro
new file mode 100644 (file)
index 0000000..a9482af
--- /dev/null
@@ -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
+}
similarity index 98%
rename from src/corelib/concurrent/qfuture.h
rename to src/concurrent/qfuture.h
index a22168a..6e99a60 100644 (file)
@@ -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
similarity index 98%
rename from src/corelib/concurrent/qfutureinterface.h
rename to src/concurrent/qfutureinterface.h
index 85272bc..f64623a 100644 (file)
@@ -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
similarity index 98%
rename from src/corelib/concurrent/qfuturesynchronizer.h
rename to src/concurrent/qfuturesynchronizer.h
index 1661cae..8b7e710 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QFUTRUESYNCHRONIZER_H
 #define QFUTRUESYNCHRONIZER_H
 
-#include <QtCore/qfuture.h>
+#include <QtConcurrent/qfuture.h>
 
 #ifndef QT_NO_CONCURRENT
 
similarity index 99%
rename from src/corelib/concurrent/qfuturewatcher.h
rename to src/concurrent/qfuturewatcher.h
index 6029331..0e94863 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QFUTUREWATCHER_H
 #define QFUTUREWATCHER_H
 
-#include <QtCore/qfuture.h>
+#include <QtConcurrent/qfuture.h>
 
 #ifndef QT_NO_QFUTURE
 
similarity index 99%
rename from src/corelib/concurrent/qtconcurrentfilter.h
rename to src/concurrent/qtconcurrentfilter.h
index f5c3865..1de8d23 100644 (file)
@@ -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
@@ -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
@@ -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>
similarity index 98%
rename from src/corelib/concurrent/qtconcurrentmap.h
rename to src/concurrent/qtconcurrentmap.h
index ef66cc1..8a55571 100644 (file)
@@ -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
similarity index 98%
rename from src/corelib/concurrent/qtconcurrentmapkernel.h
rename to src/concurrent/qtconcurrentmapkernel.h
index 47cf143..ceeaa6e 100644 (file)
@@ -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
similarity index 99%
rename from src/corelib/concurrent/qtconcurrentrun.h
rename to src/concurrent/qtconcurrentrun.h
index fc4bd01..d728538 100644 (file)
@@ -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
similarity index 99%
rename from src/corelib/concurrent/qtconcurrentrunbase.h
rename to src/concurrent/qtconcurrentrunbase.h
index 99ca0a9..2105437 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef QT_NO_CONCURRENT
 
-#include <QtCore/qfuture.h>
+#include <QtConcurrent/qfuture.h>
 #include <QtCore/qrunnable.h>
 #include <QtCore/qthreadpool.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
@@ -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 (file)
index 9402971..0000000
+++ /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
index de2b100..c8c9b9b 100644 (file)
@@ -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)
index 681cd55..c92336f 100644 (file)
@@ -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
 
index a248e18..cf3ae1b 100644 (file)
@@ -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
 
similarity index 98%
rename from src/corelib/concurrent/qthreadpool_p.h
rename to src/corelib/thread/qthreadpool_p.h
index f4c67b8..9a7c096 100644 (file)
@@ -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;
index ea6f0eb..1eefa60 100644 (file)
@@ -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 (file)
index 0000000..eccec12
--- /dev/null
@@ -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
index 8d750ba..9ef8bf4 100644 (file)
@@ -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
index cabc8a3..446f8f4 100644 (file)
@@ -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 = (
index 4f81c43..1796fa2 100644 (file)
@@ -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
+
similarity index 82%
rename from tests/auto/corelib/concurrent/concurrent.pro
rename to tests/auto/concurrent/concurrent.pro
index 6541b0c..15368ae 100644 (file)
@@ -8,6 +8,5 @@ SUBDIRS=\
    qtconcurrentmap \
    qtconcurrentresultstore \
    qtconcurrentrun \
-   qtconcurrentthreadengine \
-   qthreadpool
+   qtconcurrentthreadengine
 
@@ -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
@@ -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
 {
@@ -1,4 +1,4 @@
 CONFIG += testcase parallel_test
 TARGET = tst_qfuturewatcher
-QT = core-private testlib
+QT = concurrent-private testlib concurrent
 SOURCES = tst_qfuturewatcher.cpp
 #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;
@@ -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
 
@@ -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
@@ -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
@@ -1,4 +1,4 @@
 CONFIG += testcase parallel_test
 TARGET = tst_qtconcurrentrun
-QT = core testlib
+QT = core testlib concurrent
 SOURCES = tst_qtconcurrentrun.cpp
index ade1786..7daed39 100644 (file)
@@ -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()
 {
index be12fda..4f284ac 100644 (file)
@@ -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
index a137748..12a284c 100644 (file)
@@ -9,6 +9,7 @@ SUBDIRS=\
     qsemaphore \
     qthread \
     qthreadonce \
+    qthreadpool \
     qthreadstorage \
     qwaitcondition \
     qwritelocker