Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Remove thread_local from test_bitcoin #14985

Merged
merged 2 commits into from Dec 18, 2018

Conversation

Projects
None yet
3 participants
@MarcoFalke
Copy link
Member

commented Dec 17, 2018

thread_local seems to be highly controversial according to the discussion in #14953, so remove it again from the tests.

Also remove boost::thread_group in the test that uses it, since I am touching it anyway.

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Dec 17, 2018

@@ -26,7 +26,7 @@ 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);
}

thread_local extern FastRandomContext g_insecure_rand_ctx;
extern FastRandomContext g_insecure_rand_ctx;

static inline void SeedInsecureRand(bool deterministic = false)

This comment has been minimized.

Copy link
@laanwj

laanwj Dec 17, 2018

Member

Would make sense to add a warning comment for these helper functions to only use them from the main thread.

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1812-testNoThreadLocal branch to fa61202 Dec 17, 2018

@laanwj

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

utACK fa61202

@promag

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

utACK fa61202.

@@ -152,12 +152,13 @@ BOOST_AUTO_TEST_CASE(processnewblock_signals_ordering)
// create a bunch of threads that repeatedly process a block generated above at random
// this will create parallelism and randomness inside validation - the ValidationInterface
// will subscribe to events generated during block validation and assert on ordering invariance
boost::thread_group threads;

This comment has been minimized.

Copy link
@promag

@MarcoFalke MarcoFalke merged commit fa61202 into bitcoin:master Dec 18, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

MarcoFalke added a commit that referenced this pull request Dec 18, 2018

Merge #14985: test: Remove thread_local from test_bitcoin
fa61202 test: Add comment to g_insecure_rand_ctx (MarcoFalke)
fa0d3c4 test: Undo thread_local g_insecure_rand_ctx (MarcoFalke)

Pull request description:

  `thread_local` seems to be highly controversial according to the discussion in #14953, so remove it again from the tests.

  Also remove boost::thread_group in the test that uses it, since I am touching it anyway.

Tree-SHA512: 977c1f597e3cfbd0e97d0b037d998fdbc701f62e9a2f57e02dbe1727b63ae8ff478dbd9d3d6dc4ffdfa23f2058b331f04949d51f23a8f55b41ecb75f088f1cbe

@MarcoFalke MarcoFalke deleted the MarcoFalke:Mf1812-testNoThreadLocal branch Dec 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.