mirror of
https://github.com/pocoproject/poco.git
synced 2026-01-12 00:04:54 +08:00
committed by
GitHub
parent
ebec641893
commit
e45d2067cb
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user