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

[FIX] make a bgzf_thread_count a single variable #2752

Merged
merged 1 commit into from
Jan 18, 2022

Commits on Jan 12, 2022

  1. [FIX] make a bgzf_thread_count a single variable

    bgzf_thread_count was declared `inline static` outside of the scope of a
    class.
    In this case the `inline` allows the variable to break the one
    definition rule. Meaning there can be multiple symbols across different
    translation that all declare `bgzf_thread_count`. In this case the
    linker will choose one of the defined symbols. (Without inline it would
    throw a multiple definition error).
    
    The `static` keyword (in this context) means that the created symbol is
    only visible inside a current translation unit. Meaning, there are no symbols
    for the linker to work with. This will cause every translation unit to have there
    own `bgzf_thread_count` variable.
    
    This combination leads to every translation unit having there own
    `bgzf_thread_count` variable, which is not what a user of seqan3 expects.
    The fix is simple, we remove the `static` keyword. This should have the
    intended behavior.
    
    Thought: maybe it should be declared `thread_local`.
    SGSSGene committed Jan 12, 2022
    Configuration menu
    Copy the full SHA
    1ec1bba View commit details
    Browse the repository at this point in the history