Skip to content

Commit

Permalink
fix: avoid hSocket double lock
Browse files Browse the repository at this point in the history
It's is locked in `CloseSocketDisconnect()` already.
  • Loading branch information
UdjinM6 committed Mar 16, 2024
1 parent 2110c0c commit c9ffb72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4237,7 +4237,7 @@ void CConnman::UnregisterEvents(CNode *pnode)
{
#ifdef USE_KQUEUE
if (socketEventsMode == SOCKETEVENTS_KQUEUE) {
LOCK(pnode->cs_hSocket);
AssertLockHeld(pnode->cs_hSocket);
if (pnode->hSocket == INVALID_SOCKET) {
return;
}
Expand All @@ -4255,7 +4255,7 @@ void CConnman::UnregisterEvents(CNode *pnode)
#endif
#ifdef USE_EPOLL
if (socketEventsMode == SOCKETEVENTS_EPOLL) {
LOCK(pnode->cs_hSocket);
AssertLockHeld(pnode->cs_hSocket);
if (pnode->hSocket == INVALID_SOCKET) {
return;
}
Expand Down

0 comments on commit c9ffb72

Please sign in to comment.