aboutsummaryrefslogtreecommitdiff
path: root/src/random.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-04-20 16:47:29 +1000
committerAnthony Towns <aj@erisian.com.au>2022-05-12 02:25:55 +1000
commit7d73f58e9cea8f4b0bc16512983898fddde3d764 (patch)
treef66b9dd960d017efd1af4a56c626e439d121890f /src/random.cpp
parent9db941d7737406b8593024ba130c3f9c186af4c6 (diff)
downloadbitcoin-7d73f58e9cea8f4b0bc16512983898fddde3d764.tar.xz
Increase threadsafety annotation coverage
Diffstat (limited to 'src/random.cpp')
-rw-r--r--src/random.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/random.cpp b/src/random.cpp
index 6ae08103b1..dd12482579 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -374,7 +374,7 @@ public:
{
}
- void AddEvent(uint32_t event_info) noexcept
+ void AddEvent(uint32_t event_info) noexcept EXCLUSIVE_LOCKS_REQUIRED(!m_events_mutex)
{
LOCK(m_events_mutex);
@@ -388,7 +388,7 @@ public:
/**
* Feed (the hash of) all events added through AddEvent() to hasher.
*/
- void SeedEvents(CSHA512& hasher) noexcept
+ void SeedEvents(CSHA512& hasher) noexcept EXCLUSIVE_LOCKS_REQUIRED(!m_events_mutex)
{
// We use only SHA256 for the events hashing to get the ASM speedups we have for SHA256,
// since we want it to be fast as network peers may be able to trigger it repeatedly.
@@ -407,7 +407,7 @@ public:
*
* If this function has never been called with strong_seed = true, false is returned.
*/
- bool MixExtract(unsigned char* out, size_t num, CSHA512&& hasher, bool strong_seed) noexcept
+ bool MixExtract(unsigned char* out, size_t num, CSHA512&& hasher, bool strong_seed) noexcept EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
{
assert(num <= 32);
unsigned char buf[64];