Commit 386fa0d4 authored by Guillaume Roguez's avatar Guillaume Roguez

tls/ice transport: prevent deadlock in TLS/ICE thread

Remove the wait on rxPending_ empty queue event
in TLS thread cleanup as this event has to be trigged
by handleEvent() code, but this last is called by mainloop only,
and this lst is waiting about TLS thread end by a join()... deadlock!

Issue: #77682

Change-Id: I895f09af51deb8bab36c3c6511606586341e2783
parent 48a5ed6b
......@@ -202,6 +202,7 @@ SipsIceTransport::~SipsIceTransport()
shutdown();
tlsThread_.join();
Manager::instance().unregisterEventHandler((uintptr_t)this);
handleEvents(); // process latest incoming packets
pjsip_transport_add_ref(getTransportBase());
auto state_cb = pjsip_tpmgr_get_state_cb(trData_.base.tpmgr);
......@@ -895,13 +896,7 @@ SipsIceTransport::clean()
});
}
{
// make sure all incoming packets are reported before closing
std::unique_lock<std::mutex> l(rxMtx_);
rxCv_.wait(l, [&](){
return rxPending_.empty();
});
}
// note: incoming packets (rxPending_) will be processed in destructor
if (cookie_key_.data) {
gnutls_free(cookie_key_.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment