From 4201779de7441c03fbf0fea665d17ed2328970cc Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 7 Nov 2018 20:59:22 +0100 Subject: Revert "Use the backend SalInstance method IsMainThread for Application::IsMainThread" vcl/inc/unx/gtk/gtkinst.hxx's IsMainThread returns always false. This breaks in iahndl.cxx on Linux. This reverts commit bc089afb13029bae65b993992b3815430657ac24. Change-Id: I8fbd945e3704214d242f6f9e65760d44b0cc7d40 Reviewed-on: https://gerrit.libreoffice.org/63044 Reviewed-by: Michael Meeks Tested-by: Jenkins --- vcl/source/app/svapp.cxx | 2 +- vcl/source/app/svmain.cxx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'vcl/source') diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 0d9a2770aeb8..3221804607e3 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -520,7 +520,7 @@ comphelper::SolarMutex& Application::GetSolarMutex() bool Application::IsMainThread() { - return ImplGetSVData()->mpDefInst->IsMainThread(); + return ImplGetSVData()->mnMainThreadId == osl::Thread::getCurrentIdentifier(); } sal_uInt32 Application::ReleaseSolarMutex() diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 86db558da3e9..673e800e4ac4 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -302,6 +302,9 @@ bool InitVCL() ImplSVData* pSVData = ImplGetSVData(); + // remember Main-Thread-Id + pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier(); + // Initialize Sal pSVData->mpDefInst = CreateSalInstance(); if ( !pSVData->mpDefInst ) -- cgit