From bfb0c0a5b75da43d6aa829ef5d632fa9c56c51e7 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Thu, 23 Nov 2017 07:55:45 +0100 Subject: [PATCH] Add Clang thread safety analysis annotations --- src/net.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/net.h b/src/net.h index ffe33ea6a..d0fd05097 100644 --- a/src/net.h +++ b/src/net.h @@ -370,14 +370,14 @@ private: // Network usage totals CCriticalSection cs_totalBytesRecv; CCriticalSection cs_totalBytesSent; - uint64_t nTotalBytesRecv; - uint64_t nTotalBytesSent; + uint64_t nTotalBytesRecv GUARDED_BY(cs_totalBytesRecv); + uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent); // outbound limit & stats - uint64_t nMaxOutboundTotalBytesSentInCycle; - uint64_t nMaxOutboundCycleStartTime; - uint64_t nMaxOutboundLimit; - uint64_t nMaxOutboundTimeframe; + uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent); + uint64_t nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent); + uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent); + uint64_t nMaxOutboundTimeframe GUARDED_BY(cs_totalBytesSent); // Whitelisted ranges. Any node connecting from these is automatically // whitelisted (as well as those connecting to whitelisted binds). @@ -395,7 +395,7 @@ private: CAddrMan addrman; std::deque vOneShots; CCriticalSection cs_vOneShots; - std::vector vAddedNodes; + std::vector vAddedNodes GUARDED_BY(cs_vAddedNodes); CCriticalSection cs_vAddedNodes; std::vector vNodes; std::list vNodesDisconnected;