From 88276db37f5e3f281cffb0ece58397ecef913fcd Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 15 Apr 2016 10:42:19 -1000 Subject: [PATCH] ClientProcess fix --- hecl/CMakeLists.txt | 4 ---- hecl/extern/athena | 2 +- hecl/extern/boo | 2 +- hecl/include/hecl/ClientProcess.hpp | 1 + hecl/lib/ClientProcess.cpp | 6 ++++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hecl/CMakeLists.txt b/hecl/CMakeLists.txt index 22370cb9c..f1efb5c96 100644 --- a/hecl/CMakeLists.txt +++ b/hecl/CMakeLists.txt @@ -5,10 +5,6 @@ if(MSVC) # Shaddup MSVC add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244) else() - if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") - message(WARNING "GCC needs -fpermissive for nested type redeclarations; expect lotsa warnings!!") - endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-multichar -fno-exceptions") endif() endif() diff --git a/hecl/extern/athena b/hecl/extern/athena index d2fb800b9..617c12167 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit d2fb800b926c9d4ef76e54242c54f3fe369f7c3d +Subproject commit 617c1216750ad6da957088a4c8f9092dc508a463 diff --git a/hecl/extern/boo b/hecl/extern/boo index 5afdb62a3..f76caba01 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 5afdb62a392eaf8ae41e09b9dd37b7922abd03b5 +Subproject commit f76caba013e1a653a3ef375911949c056c054c8e diff --git a/hecl/include/hecl/ClientProcess.hpp b/hecl/include/hecl/ClientProcess.hpp index f3b0097a7..a95df203a 100644 --- a/hecl/include/hecl/ClientProcess.hpp +++ b/hecl/include/hecl/ClientProcess.hpp @@ -66,6 +66,7 @@ public: private: std::list> m_pendingQueue; std::list> m_completedQueue; + int m_inProgress = 0; bool m_running = true; struct Worker diff --git a/hecl/lib/ClientProcess.cpp b/hecl/lib/ClientProcess.cpp index 4415ab1c2..318ae650b 100644 --- a/hecl/lib/ClientProcess.cpp +++ b/hecl/lib/ClientProcess.cpp @@ -71,11 +71,13 @@ void ClientProcess::Worker::proc() while (m_proc.m_pendingQueue.size()) { std::unique_ptr trans = std::move(m_proc.m_pendingQueue.front()); + ++m_proc.m_inProgress; + m_proc.m_pendingQueue.pop_front(); lk.unlock(); trans->run(m_blendTok); lk.lock(); m_proc.m_completedQueue.push_back(std::move(trans)); - m_proc.m_pendingQueue.pop_front(); + --m_proc.m_inProgress; } m_proc.m_waitCv.notify_one(); if (!m_proc.m_running) @@ -158,7 +160,7 @@ void ClientProcess::swapCompletedQueue(std::list>& void ClientProcess::waitUntilComplete() { std::unique_lock lk(m_mutex); - while (m_pendingQueue.size()) + while (m_pendingQueue.size() || m_inProgress) m_waitCv.wait(lk); }