diff options
| author | selsta <selsta@sent.at> | 2026-05-31 02:37:15 +0200 |
|---|---|---|
| committer | selsta <selsta@sent.at> | 2026-06-01 19:22:26 +0200 |
| commit | ec60113e09d9fc985b1c35fe1c579ef73c067d91 (patch) | |
| tree | 9f22b365dee07c28cdc94bbba9f0416465a40afd /contrib | |
| parent | 8a1de602f0a049d85d6f2c7a231d90b3c9cb310e (diff) | |
| download | monzero-core-ec60113e09d9fc985b1c35fe1c579ef73c067d91.tar.gz monzero-core-ec60113e09d9fc985b1c35fe1c579ef73c067d91.tar.xz monzero-core-ec60113e09d9fc985b1c35fe1c579ef73c067d91.zip | |
p2p: make stop signal idempotent
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.inl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 56d3d7de2..f15928f45 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -1579,7 +1579,11 @@ namespace net_utils template<class t_protocol_handler> void boosted_tcp_server<t_protocol_handler>::send_stop_signal(std::function<void()> close_all_connections) { - m_stop_signal_sent = true; + if (m_stop_signal_sent.exchange(true)) + { + MDEBUG("Stop signal already sent"); + return; + } typename connection<t_protocol_handler>::shared_state *state = static_cast<typename connection<t_protocol_handler>::shared_state*>(m_state.get()); state->stop_signal_sent = true; TRY_ENTRY(); |
