Kaydet (Commit) 662c17fb authored tarafından Tor Lillqvist's avatar Tor Lillqvist

We can use thread_local on Windows, too

(In some DBG_UTIL code.)

Change-Id: I2f09c46186154551bfed5f711bd3b03efbf81053
Reviewed-on: https://gerrit.libreoffice.org/41909Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 67951d08
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment