-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow filtering a specific mutex for tracking with NANO_TIMED_LOCKS #2765
Merged
wezrule
merged 12 commits into
nanocurrency:develop
from
wezrule:filter_specific_mutex_tracking
Mar 4, 2021
Merged
Allow filtering a specific mutex for tracking with NANO_TIMED_LOCKS #2765
wezrule
merged 12 commits into
nanocurrency:develop
from
wezrule:filter_specific_mutex_tracking
Mar 4, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wezrule
added
enhancement
debug
Updates assisting with debugging and development efforts
labels
May 7, 2020
wezrule
added
the
documentation
This item indicates the need for or supplies updated or expanded documentation
label
May 7, 2020
DeepCode's analysis on #5cad3f found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
SergiySW
approved these changes
Mar 3, 2021
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
debug
Updates assisting with debugging and development efforts
documentation
This item indicates the need for or supplies updated or expanded documentation
enhancement
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.
This works by creating a wrapper around a std::mutex with a string constructor argument where a name for the mutex is specified. Users can register a mutex to track with the new
NANO_TIMED_LOCKS_FILTER
CMake variable, giving it a string matching one of the allowed mutex strings.The actual files which changed are:
locks.hpp/cpp
- Addednano::mutex
class which has a constructor for passing in the name. In non NANO_TIMED_LOCKS builds, we want this class to have as little impact as possible (hence all the preprocessor guards).CMakeLists.txt - Added new CMake variable
NANO_TIMED_LOCKS_FILTER
which currently allows any of ~20 named mutexes for tracking. I picked (I think) the most useful ones rather than add them all. Only a single one can be selected. Multiple is technically possible but not implemented here as theres a lot more value in targeting a specific one (due to interference due to slow generation of stacktraces on Windows for instance).The mutexes which need tracking now use the new string constructor.
Updated core_tests/locks.cpp as if
NANO_TIMED_LOCKS_FILTER
is specified the tests would have otherwise failed fail.Updated CI so that it is mandatory for
nano::mutex
to be used. It is not mandatory that it be named, the default constructor is fine to use.