summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-06 09:34:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-06 09:34:22 (GMT)
commit584a8b188a24aed8b0130cbc2d3b0ade774d1d07 (patch)
treeb79a5e0f382292982776b2c25cb0e578f3b1e2d7 /src/doxygen.cpp
parent45431b45fa0591a6de6b47c3fe9ff8dd0032aa4e (diff)
downloadDoxygen-584a8b188a24aed8b0130cbc2d3b0ade774d1d07.zip
Doxygen-584a8b188a24aed8b0130cbc2d3b0ade774d1d07.tar.gz
Doxygen-584a8b188a24aed8b0130cbc2d3b0ade774d1d07.tar.bz2
Implement better solution for ThreadPool and std::packaged_task
Careful analysis of the compilation problems with Visual Studio revealed that moving a std::packaged_task<R()> into a std::packaged_task<void()> is a bit controversal as to whether or not it is supposed to work at all or if it triggers undefined behavior. I've now implemented the second solution as suggested here: https://stackoverflow.com/a/31078143/784672 This avoid such conversion altogether and make the Threadpool class more generic again.
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 776caca..0075e32 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -9143,8 +9143,8 @@ static void parseFilesMultiThreading(const std::shared_ptr<Entry> &root)
numThreads = std::thread::hardware_concurrency();
}
msg("Processing input using %lu threads.\n",numThreads);
+ ThreadPool threadPool(numThreads);
using FutureType = std::vector< std::shared_ptr<Entry> >;
- ThreadPool<FutureType> threadPool(numThreads);
std::vector< std::future< FutureType > > results;
for (const auto &s : g_inputFiles)
{
@@ -9238,8 +9238,8 @@ static void parseFilesMultiThreading(const std::shared_ptr<Entry> &root)
{
std::size_t numThreads = std::thread::hardware_concurrency();
msg("Processing input using %lu threads.\n",numThreads);
+ ThreadPool threadPool(numThreads);
using FutureType = std::shared_ptr<Entry>;
- ThreadPool< FutureType > threadPool(numThreads);
std::vector< std::future< FutureType > > results;
for (const auto &s : g_inputFiles)
{