Skip to content

Commit 01ec1c3

Browse files
committed
fix(TCPServer): first attempt to silence TSAN #4892
1 parent ed65f83 commit 01ec1c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Net/include/Poco/Net/SocketImpl.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ class Net_API SocketImpl: public Poco::RefCountedObject
295295
/// If count is != 0, sends the given number of bytes, otherwise
296296
/// sends all bytes, starting from the given offset.
297297
///
298-
/// On Linux, macOS and FreeBSD systems, the implementation
298+
/// On Linux, macOS and FreeBSD systems, the implementation
299299
/// uses sendfile() or sendfile64().
300300
/// On Windows, the implementation uses TransmitFile().
301301
///
302-
/// If neither sendfile() nor TransmitFile() is available,
302+
/// If neither sendfile() nor TransmitFile() is available,
303303
/// or the socket is a secure one (secure() returne true),
304304
/// falls back to reading the file block by block and calling sendBytes().
305305
///
306306
/// Returns the number of bytes sent, which should be the same
307307
/// as count, unless count is 0.
308308
///
309309
/// Throws NetException (or a subclass) in case of any errors.
310-
/// Also throws a NetException if the socket has been set to
310+
/// Also throws a NetException if the socket has been set to
311311
/// non-blocking.
312312

313313
virtual int available();
@@ -578,7 +578,7 @@ class Net_API SocketImpl: public Poco::RefCountedObject
578578
SocketImpl(const SocketImpl&);
579579
SocketImpl& operator = (const SocketImpl&);
580580

581-
poco_socket_t _sockfd;
581+
std::atomic<poco_socket_t> _sockfd;
582582
Poco::Timespan _recvTimeout;
583583
Poco::Timespan _sndTimeout;
584584
bool _blocking;
@@ -636,7 +636,7 @@ inline bool SocketImpl::getBlocking() const
636636

637637

638638
#if defined(POCO_OS_FAMILY_WINDOWS)
639-
#pragma comment(lib, "mswsock.lib")
640-
#endif
639+
#pragma comment(lib, "mswsock.lib")
640+
#endif
641641

642642
#endif // Net_SocketImpl_INCLUDED

0 commit comments

Comments
 (0)