mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 17:29:24 +00:00
Fixed possible thread handle leak
This commit is contained in:
parent
b3d72cbfcb
commit
f3045a5e80
2 changed files with 1 additions and 7 deletions
|
@ -27,7 +27,6 @@ TCPServer::TCPServer(int default_backlog, allocate_client_callback allocate_new_
|
|||
: m_allocateNewClient(allocate_new_client)
|
||||
, m_defaultBacklog(default_backlog)
|
||||
, m_loopThread{}
|
||||
, m_loopThreadRunning(false)
|
||||
#ifdef WITH_UPNP
|
||||
, m_portMapping(0)
|
||||
#endif
|
||||
|
@ -474,9 +473,7 @@ void TCPServer::shutdown_tcp()
|
|||
}
|
||||
#endif
|
||||
|
||||
if (m_loopThreadRunning.load()) {
|
||||
uv_thread_join(&m_loopThread);
|
||||
}
|
||||
|
||||
uv_mutex_destroy(&m_bansLock);
|
||||
|
||||
|
@ -581,8 +578,6 @@ const char* TCPServer::get_log_category() const
|
|||
void TCPServer::loop(void* data)
|
||||
{
|
||||
TCPServer* server = static_cast<TCPServer*>(data);
|
||||
server->m_loopThreadRunning.exchange(true);
|
||||
ON_SCOPE_LEAVE([server]() { server->m_loopThreadRunning.exchange(false); });
|
||||
|
||||
log_category_prefix = server->get_log_category();
|
||||
|
||||
|
|
|
@ -149,7 +149,6 @@ protected:
|
|||
int m_defaultBacklog;
|
||||
|
||||
uv_thread_t m_loopThread;
|
||||
std::atomic<bool> m_loopThreadRunning;
|
||||
|
||||
static void loop(void* data);
|
||||
|
||||
|
|
Loading…
Reference in a new issue