fix(Net): TSAN warnings #5147 (#5148)

This commit is contained in:
Aleksandar Fabijanic
2026-01-04 22:10:47 -06:00
committed by GitHub
parent ebec641893
commit e45d2067cb
2 changed files with 6 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Mutex.h"
#include <atomic>
namespace Poco {
@@ -54,7 +55,7 @@ protected:
private:
HTTPServerParams::Ptr _pParams;
HTTPRequestHandlerFactory::Ptr _pFactory;
bool _stopped;
std::atomic<bool> _stopped;
Poco::FastMutex _mutex;
};

View File

@@ -24,6 +24,7 @@
#include "Poco/RefCountedObject.h"
#include "Poco/Timespan.h"
#include "Poco/Buffer.h"
#include <atomic>
namespace Poco {
@@ -578,7 +579,7 @@ private:
SocketImpl(const SocketImpl&);
SocketImpl& operator = (const SocketImpl&);
poco_socket_t _sockfd;
std::atomic<poco_socket_t> _sockfd;
Poco::Timespan _recvTimeout;
Poco::Timespan _sndTimeout;
bool _blocking;
@@ -606,13 +607,13 @@ inline SocketImpl::Type SocketImpl::type()
inline poco_socket_t SocketImpl::sockfd() const
{
return _sockfd;
return _sockfd.load();
}
inline bool SocketImpl::initialized() const
{
return _sockfd != POCO_INVALID_SOCKET;
return _sockfd.load() != POCO_INVALID_SOCKET;
}