-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Switched sync.{cpp,h} to std threading primitives. #11722
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
Conversation
Given that it's only used when lock debugging is used I'd say it's acceptable. Also FWIW I tried to build bitcoin on g++ 4.7 a while ago and it was a pain; for example the |
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
|
|
||
| #include <sync.h> | ||
|
|
||
| #include <set> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazingly enough the #include tree in sync.cpp did not pull in std::set already.
|
Concept ACK |
|
Since #11732 was resolved in favor of bumping GCC requirement to 4.8, looks like this PR is good to go? |
|
utACK bba9bd0 |
theuni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thread_local was also off-limits due to missing support in osx's clang. It's been added as of XCode 8 on September 13, 2016. I'm uneasy with that as a minimum requirement.
Additionally, last time I checked this, the use of thread_local causes new symbols to be pulled in from glibc on Linux, meaning that we would lose back-compat with older versions. I'd have to re-test to see where the break lies.
That said, I think it's ok to lessen the requirement for the DEBUG_LOCKCONTENTION case, as long as there's a comment there mentioning that it's problematic for other code.
As osx is probably not the only platform where this will cause headaches, I'd also prefer to add an autoconf link test for thread_local.
|
utACK bba9bd0 modulo thread_local concerns. I also think its probably OK in DEBUG_LOCKCONTENTION only even if its not on all supported platforms. |
|
Pushed up a commit on top of this PR that adds the configure check for thread_local: theuni@d6df116 . I've verified that it works as intended for me in Linux, and breaks as intended on osx. @tjps assuming that works for you, mind cherry-picking it here? |
|
That looks great to me, will cherry-pick it onto this PR. |
theuni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! utACK f7f7e2c.
f7f7e2c threads: add a thread_local autoconf check (Cory Fields) bba9bd0 Switched sync.{cpp,h} to std threading primitives. (Thomas Snider) Pull request description: Replaced boost threading primitives with the std equivalents. Tree-SHA512: 72d10f9e48bfcf1db87e4a88bc698ef98eba0b29fe904570391b34a6ea1ffad474b7f192e70e3588a30e448f70f244eb4ddc5f24412a0bde2b564e76274160a5
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - bitcoin#11722 (review) - bitcoin#13168 (comment)
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - bitcoin/bitcoin#11722 (review) - bitcoin/bitcoin#13168 (comment)
f7f7e2c threads: add a thread_local autoconf check (Cory Fields) bba9bd0 Switched sync.{cpp,h} to std threading primitives. (Thomas Snider) Pull request description: Replaced boost threading primitives with the std equivalents. Tree-SHA512: 72d10f9e48bfcf1db87e4a88bc698ef98eba0b29fe904570391b34a6ea1ffad474b7f192e70e3588a30e448f70f244eb4ddc5f24412a0bde2b564e76274160a5
f7f7e2c threads: add a thread_local autoconf check (Cory Fields) bba9bd0 Switched sync.{cpp,h} to std threading primitives. (Thomas Snider) Pull request description: Replaced boost threading primitives with the std equivalents. Tree-SHA512: 72d10f9e48bfcf1db87e4a88bc698ef98eba0b29fe904570391b34a6ea1ffad474b7f192e70e3588a30e448f70f244eb4ddc5f24412a0bde2b564e76274160a5
Replaced boost threading primitives with the std equivalents.