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

src: make nsolid::ThreadMetrics safer #37

Merged
merged 1 commit into from
Dec 13, 2023

Commits on Dec 13, 2023

  1. src: make nsolid::ThreadMetrics safer

    The current ThreadMetrics API is not easy to use safely because the
    `ThreadMetrics` instance needs to be alive while there is a pending
    `Update()` callback to be called. Change the API to use shared_ptr, as
    we define a new type `SharedThreadMetrics` as
    `std::shared_ptr<ThreadMetrics>`.
    This is a breaking change but considering previous API was completely
    unsafe and apparently there're still no consumers I think is a good
    change.
    
    PR-URL: #37
    Reviewed-by: Trevor Norris <trev.norris@gmail.com>
    santigimeno committed Dec 13, 2023
    1 Configuration menu
    Copy the full SHA
    a218600 View commit details
    Browse the repository at this point in the history