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

Use thread local for libunwind GetStackTrace() reentrancy protection #161

Merged
merged 1 commit into from
Oct 31, 2019

Commits on Jan 28, 2017

  1. Use thread local for libunwind GetStackTrace()

    Previously, the implementation of google::GetStackTrace() that uses
    libunwind uses a global variable that enforces that only one thread may
    invoke libunwind at a time. However, libunwind is thread-safe. The
    comment above the variable indicates that it is to protect against
    reentrancy issues.
    
    Instead of using a global variable, it would be much better to use a
    thread-local variable to protect against these reentrancy issues. That
    should provide the needed reentrancy protection while allowing multiple
    threads to get stack traces at the same time.
    
    It also allows for the removal of the atomic CAS operations on the
    variable.
    
    Resolves google#160.
    mpercy committed Jan 28, 2017
    Configuration menu
    Copy the full SHA
    f581614 View commit details
    Browse the repository at this point in the history