aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-12-27 09:28:04 +0000
committerJohn Newbery <john@johnnewbery.com>2021-01-02 16:51:44 +0000
commit378aedc45248cea82d9a3e6dc1038d6828008a76 (patch)
tree7e2cf721396180d17c4e7072f6dfe4adcb09d234
parent673254515a2f97e53dd8c7335c836b083ba7e31a (diff)
[net] Add cs_vSend lock annotations
-rw-r--r--src/net.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index 1520a54686..2b97d61184 100644
--- a/src/net.h
+++ b/src/net.h
@@ -857,8 +857,10 @@ public:
// socket
std::atomic<ServiceFlags> nServices{NODE_NONE};
SOCKET hSocket GUARDED_BY(cs_hSocket);
- size_t nSendSize{0}; // total size of all vSendMsg entries
- size_t nSendOffset{0}; // offset inside the first vSendMsg already sent
+ /** Total size of all vSendMsg entries */
+ size_t nSendSize GUARDED_BY(cs_vSend){0};
+ /** Offset inside the first vSendMsg already sent */
+ size_t nSendOffset GUARDED_BY(cs_vSend){0};
uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
RecursiveMutex cs_vSend;
@@ -989,7 +991,7 @@ public:
Network ConnectedThroughNetwork() const;
protected:
- mapMsgCmdSize mapSendBytesPerMsgCmd;
+ mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
public: