Skip to content
Snippets Groups Projects
Commit 1ceec4d7 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

multiplexed_socket: avoid deadlock on cbMtx_

cbMtx_ is locked when onStateChangeCb_ is called. And onTlsStateChange
can call shutdown() which MUST NOT relock cbMtx_.

Change-Id: Ice8265b9a70f920a4f04451c19a752f260ef71b7
parent 232e133f
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ public:
~Impl() {
if (!isShutdown_) {
if (endpoint) endpoint->setOnStateChange({});
shutdown();
} else {
std::lock_guard<std::mutex> lkSockets(socketsMutex);
......@@ -68,7 +69,6 @@ public:
isShutdown_ = true;
if (onShutdown_) onShutdown_();
if (endpoint) {
endpoint->setOnStateChange({});
std::unique_lock<std::mutex> lk(writeMtx);
endpoint->shutdown();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment