aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-12-17 13:19:07 -0500
committerMarcoFalke <falke.marco@gmail.com>2018-12-17 13:13:02 -0500
commitfa61202cae6979c754b11842c5ed8d90f1cdcc45 (patch)
treec507964a3c5e5242eb7f2ec8edd9007d5a118104 /src/test
parentfa0d3c44073ab67d3f2e682dba7d3668daa55e25 (diff)
downloadbitcoin-fa61202cae6979c754b11842c5ed8d90f1cdcc45.tar.xz
test: Add comment to g_insecure_rand_ctx
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_bitcoin.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h
index 2d49faf8c9..31d90c0151 100644
--- a/src/test/test_bitcoin.h
+++ b/src/test/test_bitcoin.h
@@ -26,6 +26,13 @@ std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::os
return stream << static_cast<typename std::underlying_type<T>::type>(e);
}
+/**
+ * This global and the helpers that use it are not thread-safe.
+ *
+ * If thread-safety is needed, the global could be made thread_local (given
+ * that thread_local is supported on all architectures we support) or a
+ * per-thread instance could be used in the multi-threaded test.
+ */
extern FastRandomContext g_insecure_rand_ctx;
static inline void SeedInsecureRand(bool deterministic = false)