comphelper/source/misc/threadpool.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 662c17fbd2ea72247d6ab94583f505dc242e1e8f Author: Tor Lillqvist <t...@collabora.com> Date: Mon Sep 4 20:32:38 2017 +0300 We can use thread_local on Windows, too (In some DBG_UTIL code.) Change-Id: I2f09c46186154551bfed5f711bd3b03efbf81053 Reviewed-on: https://gerrit.libreoffice.org/41909 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tor Lillqvist <t...@collabora.com> diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index e67bacb8bd6b..7368544a14b1 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -22,7 +22,7 @@ namespace comphelper { /** prevent waiting for a task from inside a task */ -#if defined DBG_UTIL && defined LINUX +#if defined DBG_UTIL && (defined LINUX || defined _WIN32) static thread_local bool gbIsWorkerThread; #endif @@ -55,7 +55,7 @@ public: virtual void execute() override { -#if defined DBG_UTIL && defined LINUX +#if defined DBG_UTIL && (defined LINUX || defined _WIN32) gbIsWorkerThread = true; #endif std::unique_lock< std::mutex > aGuard( mpPool->maMutex ); @@ -215,7 +215,7 @@ ThreadTask *ThreadPool::popWorkLocked( std::unique_lock< std::mutex > & rGuard, void ThreadPool::waitUntilDone(const std::shared_ptr<ThreadTaskTag>& rTag) { -#if defined DBG_UTIL && defined LINUX +#if defined DBG_UTIL && (defined LINUX || defined _WIN32) assert(!gbIsWorkerThread && "cannot wait for tasks from inside a task"); #endif { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits