mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 17:29:24 +00:00
TCPServer: added thread check on connection close
This commit is contained in:
parent
6eff190f87
commit
cfddaf1508
1 changed files with 3 additions and 1 deletions
|
@ -419,6 +419,7 @@ void TCPServer::check_event_loop_thread(const char* func) const
|
||||||
{
|
{
|
||||||
if (server_event_loop_thread != this) {
|
if (server_event_loop_thread != this) {
|
||||||
LOGERR(1, func << " called from another thread, this is not thread safe");
|
LOGERR(1, func << " called from another thread, this is not thread safe");
|
||||||
|
PANIC_STOP();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1213,9 +1214,10 @@ void TCPServer::Client::close()
|
||||||
// Already closed
|
// Already closed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isClosing = true;
|
m_isClosing = true;
|
||||||
|
|
||||||
|
m_owner->check_event_loop_thread(__func__);
|
||||||
|
|
||||||
uv_read_stop(reinterpret_cast<uv_stream_t*>(&m_socket));
|
uv_read_stop(reinterpret_cast<uv_stream_t*>(&m_socket));
|
||||||
|
|
||||||
uv_tcp_t* s = &m_socket;
|
uv_tcp_t* s = &m_socket;
|
||||||
|
|
Loading…
Reference in a new issue