Skip to content

Commit

Permalink
remove thread detachment
Browse files Browse the repository at this point in the history
  • Loading branch information
AviaAv committed Dec 29, 2024
1 parent ec36486 commit 1f127ec
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions third-party/realdds/src/dds-network-adapter-watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class network_adapter_watcher_singleton
if( new_ips.size() || old_ips.size() )
callbacks.raise( new_ips, old_ips );
}
_th.detach(); // so it's not joinable
LOG_DEBUG( "done waiting for IP changes" );
} );
}
Expand All @@ -72,15 +71,8 @@ class network_adapter_watcher_singleton
~network_adapter_watcher_singleton()
{
_adapter_watcher.reset(); // signal the thread to finish
try
{
if (_th.joinable())
_th.join();
}
catch (std::system_error& e)
{
LOG_ERROR("Network adapter watcher termination failed: " << e.what());
}
if (_th.joinable())
_th.join();
}

void update_ips( ip_set * p_new_ips = nullptr, ip_set * p_old_ips = nullptr )
Expand Down

0 comments on commit 1f127ec

Please sign in to comment.