Skip to content
Snippets Groups Projects
Commit cee36262 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

ConnectionManager: send beacon on io pool

Avoids blocking on socket write sequentially,
and prevents locking while blocked on a write.

Change-Id: Ie9444916cd5414a4379178560b316327c8a1bb67
parent 9352fdea
No related branches found
No related tags found
No related merge requests found
...@@ -1291,7 +1291,7 @@ ConnectionManager::Impl::onTlsNegotiationDone(const std::shared_ptr<DeviceInfo>& ...@@ -1291,7 +1291,7 @@ ConnectionManager::Impl::onTlsNegotiationDone(const std::shared_ptr<DeviceInfo>&
for (const auto& cinfo: previousConnections) { for (const auto& cinfo: previousConnections) {
std::lock_guard lk {cinfo->mutex_}; std::lock_guard lk {cinfo->mutex_};
if (cinfo->socket_) { if (cinfo->socket_) {
cinfo->socket_->sendBeacon(); dht::ThreadPool::io().run([s = cinfo->socket_] { s->sendBeacon(); });
} }
} }
// Finally, launch pending callbacks // Finally, launch pending callbacks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment