Page MenuHomePhabricator

[backport#14953] test: Make g_insecure_rand_ctx thread_local
AbandonedPublic

Authored by majcosta on Jun 22 2020, 06:07.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

faead93c6c test: Make g_insecure_rand_ctx thread_local (MarcoFalke)

Pull request description:

Some tests might spin up several threads and `FastRandomContext` is not thread safe.

Fix that by giving each thread their own randomness context (as opposed to e.g. making `FastRandomContext` thread safe or add locks elsewhere).

Also, add the `g_` prefix to it (according to developer notes), since I am touching it anyway.

https://github.com/bitcoin/bitcoin/pull/14953/commits/faead93c6c7e1d27bd2a1b2a9b496fda838c2996


Backport of Core PR14953

Test Plan
ninja check

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision now requires changes to proceed.Jun 22 2020, 07:41