[Libreoffice-commits] core.git: comphelper/source

Tor Lillqvist tml at collabora.com
Mon Sep 4 20:30:04 UTC 2017


 comphelper/source/misc/threadpool.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 662c17fbd2ea72247d6ab94583f505dc242e1e8f
Author: Tor Lillqvist <tml at 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 <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at 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
     {


More information about the Libreoffice-commits mailing list