Skip to content

Commit 378aedc

Browse files
committed
[net] Add cs_vSend lock annotations
1 parent 6732545 commit 378aedc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/net.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,10 @@ class CNode
857857
// socket
858858
std::atomic<ServiceFlags> nServices{NODE_NONE};
859859
SOCKET hSocket GUARDED_BY(cs_hSocket);
860-
size_t nSendSize{0}; // total size of all vSendMsg entries
861-
size_t nSendOffset{0}; // offset inside the first vSendMsg already sent
860+
/** Total size of all vSendMsg entries */
861+
size_t nSendSize GUARDED_BY(cs_vSend){0};
862+
/** Offset inside the first vSendMsg already sent */
863+
size_t nSendOffset GUARDED_BY(cs_vSend){0};
862864
uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
863865
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
864866
RecursiveMutex cs_vSend;
@@ -989,7 +991,7 @@ class CNode
989991
Network ConnectedThroughNetwork() const;
990992

991993
protected:
992-
mapMsgCmdSize mapSendBytesPerMsgCmd;
994+
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
993995
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
994996

995997
public:

0 commit comments

Comments
 (0)