Convert __sync* built-ins to std::atomic #265
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I suspect these changes mean that
lt_cacheline_aligned
is no longer required for some of the objects, but left them alone since I wasn't 100% on that.Addresses #253
Notable changes:
thread_base::m_global
was simply changed to use std::atomic/std::mutex, it couldn't be initialized as a protected static member outside of the class in C++14 due to not being able to guarantee copy elision for std::atomic's construction. C++17 fixes this, but in the meantime I broke it out into two separate members since we shouldn't strictly need tolt_cacheline_aligned
them together anymore.