Skip to content

BearerTokenAuthenticationPolicy can be more efficient by utilizing shared/unique token locking #4756

@antkmsft

Description

@antkmsft

We can shared_lock when checking if the token has not expired, and then unique_lock when we know that we need to update the token, but just before updating (which sends network request), check for the second time in case another thread has just updated it.

include <shared_nutex> nut use shared_timed_mutex and not shared_mutex, because the first is C++14, while the other is C++17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Azure.IdentityClientThis issue points to a problem in the data-plane of the library.feature-requestThis issue requires a new behavior in the product in order be resolved.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions