aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-04 14:49:04 +0200
committerGitHub <[email protected]>2023-10-04 14:49:04 +0200
commit05d415a12e73a36ca9133b7b66ccc03057e65883 (patch)
tree9175fe21be95a9fec5c2f4fdb4875d99c5dd10cc
parentshared server config (#438) (diff)
downloadzen-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
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenserver/windows/service.cpp4
-rw-r--r--src/zenserver/zenserver.cpp2
-rw-r--r--src/zenutil/openprocesscache.cpp2
4 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c21334e2..b729c4a9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,7 @@
- Improvement: Make sure cache and cas MakeIndexSnapshot does not throw exception on failure which would cause and abnormal termniation at exit
- Improvement: http.sys I/O completion handler no longer holds transaction lock while enqueueing new requests. This eliminates some lock contention and improves latency/throughput for certain types of requests
- Improvement: date logging in GC no longer emits extraneous newlines
+- Improvement: named main thread and thread handle cache thread
- Improvement: removed websockets support as it is not used and likely won't be used in the future
## 0.2.25
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