From 0bf4d5666b93f7f03f47f71eeff9d09208a1af86 Mon Sep 17 00:00:00 2001 From: Emanuele Danovaro Date: Tue, 1 Oct 2024 10:42:04 +0100 Subject: [PATCH] wip --- src/eckit/net/TCPServer.cc | 2 ++ src/eckit/net/TCPServer.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/eckit/net/TCPServer.cc b/src/eckit/net/TCPServer.cc index 425709dbe..5f264047d 100644 --- a/src/eckit/net/TCPServer.cc +++ b/src/eckit/net/TCPServer.cc @@ -36,6 +36,8 @@ TCPServer::~TCPServer() { TCPSocket& TCPServer::accept(const std::string& message, int timeout, bool* connected) { + std::lock_guard lock(acceptMutex_); + bind(); sockaddr_in from; diff --git a/src/eckit/net/TCPServer.h b/src/eckit/net/TCPServer.h index e29f6e861..0d0c1e827 100644 --- a/src/eckit/net/TCPServer.h +++ b/src/eckit/net/TCPServer.h @@ -58,6 +58,7 @@ class TCPServer : public TCPSocket, private NonCopyable { private: // members bool closeExec_; Mutex mutex_; + std::recursive_mutex acceptMutex_; }; //----------------------------------------------------------------------------------------------------------------------