summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-11 10:31:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-11 10:56:06 +0100
commitb162753eadd963fdbad691e30005182e2d9d538a (patch)
tree50d95e2774e33f5846c70ecaeb0958ec2ad32f9c /desktop
parent5035225803b6d0fba4b36321f1c18db0fbb31f19 (diff)
Use osl/thread.h abstraction
...which already takes care of things like increasing stack size under ASan Change-Id: I89f9a25a660aacd41e1125766b23f7be395e7af8
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0c2f4a943a2d..922ec882f2ce 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -23,6 +23,7 @@
#include <tools/errinf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
+#include <osl/thread.h>
#include <rtl/strbuf.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx>
@@ -277,7 +278,7 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
{
OUString maLastExceptionMsg;
shared_ptr< LibreOfficeKitClass > m_pOfficeClass;
- pthread_t maThread;
+ oslThread maThread;
LibLibreOffice_Impl()
: maThread(0)
@@ -813,10 +814,9 @@ static bool initialize_uno(const OUString& aAppProgramURL)
return true;
}
-static void* lo_startmain(void*)
+static void lo_startmain(void*)
{
soffice_main();
- return 0;
}
static bool bInitialized = false;
@@ -885,7 +885,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
SAL_INFO("lok", "Enabling OfficeIPCThread");
OfficeIPCThread::EnableOfficeIPCThread();
SAL_INFO("lok", "Starting soffice_main");
- pthread_create(&(pLib->maThread), 0, lo_startmain, NULL);
+ pLib->maThread = osl_createThread(lo_startmain, NULL);
SAL_INFO("lok", "Waiting for OfficeIPCThread");
OfficeIPCThread::WaitForReady();
SAL_INFO("lok", "OfficeIPCThread ready -- continuing");
@@ -948,7 +948,8 @@ static void lo_destroy(LibreOfficeKit* pThis)
SAL_INFO("lok", "LO Destroy");
Application::Quit();
- pthread_join(pLib->maThread, NULL);
+ osl_joinWithThread(pLib->maThread);
+ osl_destroyThread(pLib->maThread);
delete pLib;
bInitialized = false;