diff options
| author | Stefan Boberg <[email protected]> | 2023-10-04 14:49:04 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-04 14:49:04 +0200 |
| commit | 05d415a12e73a36ca9133b7b66ccc03057e65883 (patch) | |
| tree | 9175fe21be95a9fec5c2f4fdb4875d99c5dd10cc /src | |
| parent | shared server config (#438) (diff) | |
| download | zen-05d415a12e73a36ca9133b7b66ccc03057e65883.tar.xz zen-05d415a12e73a36ca9133b7b66ccc03057e65883.zip | |
added thread names (#441)
added names to process handle GC thread and main thread for easier identification in crash dumps / process monitoring
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/windows/service.cpp | 4 | ||||
| -rw-r--r-- | src/zenserver/zenserver.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/openprocesscache.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/zenserver/windows/service.cpp b/src/zenserver/windows/service.cpp index 21116f1c4..cb87df1f6 100644 --- a/src/zenserver/windows/service.cpp +++ b/src/zenserver/windows/service.cpp @@ -7,7 +7,7 @@ #if ZEN_PLATFORM_WINDOWS # include <zencore/except.h> -# include <zencore/zencore.h> +# include <zencore/thread.h> # include <stdio.h> # include <tchar.h> @@ -151,6 +151,8 @@ CallMain(DWORD, LPSTR*) int WindowsService::ServiceMain() { + zen::SetCurrentThreadName("svc-main"); + gSvc = this; SERVICE_TABLE_ENTRY DispatchTable[] = {{(LPWSTR)SVCNAME, (LPSERVICE_MAIN_FUNCTION)&CallMain}, {NULL, NULL}}; diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index 83eb81e3b..0555fab79 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -1144,6 +1144,8 @@ SentryLogFunction(sentry_level_t Level, const char* Message, va_list Args, [[may int ZenEntryPoint::Run() { + zen::SetCurrentThreadName("main"); + #if ZEN_USE_SENTRY int SentryErrorCode = 0; std::unique_ptr<zen::utils::SentryAssertImpl> SentryAssert; diff --git a/src/zenutil/openprocesscache.cpp b/src/zenutil/openprocesscache.cpp index b8f01dd54..39e4aea90 100644 --- a/src/zenutil/openprocesscache.cpp +++ b/src/zenutil/openprocesscache.cpp @@ -167,6 +167,8 @@ OpenProcessCache::GCHandles() void OpenProcessCache::GcWorker() { + SetCurrentThreadName("ProcessCache_GC"); + while (!m_GcExitEvent.Wait(500)) { try |