summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-09-04 20:32:38 +0300
committerTor Lillqvist <tml@collabora.com>2017-09-04 22:29:42 +0200
commit662c17fbd2ea72247d6ab94583f505dc242e1e8f (patch)
treef72b2ddb3758e695f07eea8fa4b44df3c6a7bc02 /comphelper
parent67951d08ddd20ac87fc7eb54a90cb81901a89f8c (diff)
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@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/threadpool.cxx6
1 files changed, 3 insertions, 3 deletions
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
{