# HG changeset patch # User Sebastien Jodogne # Date 1786446694 -7200 # Node ID ada5c9e13781c6f7179145d832c163caa3082ac2 # Parent cb558bd6ba67cc1e7beae307dab72c5539d0f5ea added missing lock diff -r cb558bd6ba67 -r ada5c9e13781 OrthancFramework/Sources/HttpServer/HttpServer.cpp --- a/OrthancFramework/Sources/HttpServer/HttpServer.cpp Tue Aug 11 12:38:13 2026 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpServer.cpp Tue Aug 11 13:11:34 2026 +0200 @@ -1828,8 +1828,11 @@ void HttpServer::Start() { - // reset thread counter used to generate HTTP thread names. - threadCounter_ = 0; + { + // reset thread counter used to generate HTTP thread names. + boost::unique_lock lock(threadCounterMutex_); + threadCounter_ = 0; + } #if ORTHANC_ENABLE_MONGOOSE == 1 CLOG(INFO, HTTP) << "Starting embedded Web server using Mongoose"; @@ -2473,7 +2476,7 @@ std::string HttpServer::GetCurrentThreadName() { // threads are created in CivetWeb -> assign them a name the first time they are used - boost::thread::id threadId = boost::this_thread::get_id(); + const boost::thread::id threadId = boost::this_thread::get_id(); boost::upgrade_lock readerLock(threadCounterMutex_); // reader lock to check if the threadId has already been registered