diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-08 09:49:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-09 12:26:01 +0100 |
commit | 4ff2ee082c5de428d3426005023e7362cb75200d (patch) | |
tree | 6a5cbed7cc9d25856759be29e6ec317e9a625a07 /vcl | |
parent | 6da092245a0c61223c8fd0d4b2bd183ae3342a55 (diff) |
give main thread on Windows a name
to make it easier to find in profilers and debuggers
Change-Id: I8ce3ee0b89ca8498683367c2b39176edc571137b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/win/salinst.h | 1 | ||||
-rw-r--r-- | vcl/win/app/salinst.cxx | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index c62a68ae0455..35f2365fb166 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -43,6 +43,7 @@ public: WinSalInstance(); virtual ~WinSalInstance() override; + virtual void AfterAppInit() override; virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; virtual void DestroyFrame( SalFrame* pFrame ) override; diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index b903247d2d85..5ba2f9cd50e6 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -458,6 +458,15 @@ WinSalInstance::~WinSalInstance() #endif } +void WinSalInstance::AfterAppInit() +{ +// (1) Ideally this would be done at the place that creates the thread, but since this thread is normally +// just the default/main thread, that is not possible. +// (2) Don't do this on unix, where it causes tools like pstree on Linux to +// confusingly report soffice.bin as VCL Main instead. + osl_setThreadName("VCL Main"); +} + static LRESULT ImplSalDispatchMessage( const MSG* pMsg ) { SalData* pSalData = GetSalData(); |