From f2a1ad0e53632ad69729c9bd55edcdfe8ef98368 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 22 Oct 2026 11:36:21 -0400 Subject: Do not abort when a shutdown thread joins itself (#37) std::thread::join throws system_error if the caller is the thread being joined. That uncaught exception aborted the process during shutdown. Detach the current thread instead, and catch a join that still throws. --- indra/llcorehttp/llwebsocketmgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcorehttp/llwebsocketmgr.cpp') diff --git a/indra/llcorehttp/llwebsocketmgr.cpp b/indra/llcorehttp/llwebsocketmgr.cpp index ef07295eed..701fbd5446 100644 --- a/indra/llcorehttp/llwebsocketmgr.cpp +++ b/indra/llcorehttp/llwebsocketmgr.cpp @@ -28,6 +28,7 @@ #include "llwebsocketmgr.h" #include "llerror.h" +#include "llthread.h" #include "llsdserialize.h" #include "llhost.h" #include "llsdjson.h" @@ -508,7 +509,7 @@ void LLWebsocketMgr::WSServer::stop() << "thread-boundary regression." << LL_ENDL; } - mServerThread.join(); + ll_join_thread(mServerThread); LL_INFOS("WebSocket") << "WebSocket server thread joined for: " << mServerName << LL_ENDL; } onStopped(); -- cgit v1.3