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

generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence #30

Merged
merged 1 commit into from
Sep 19, 2014
Merged

generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence #30

merged 1 commit into from
Sep 19, 2014

Commits on Sep 19, 2014

  1. generic atomicops: promote Acquire_Store() and Release_Load() to use …

    …SEQ_CST fence
    
    __atomic_store_n() cannot take a memory model argument of
    __ATOMIC_ACQUIRE, and __atomic_load_n() cannot take a memory model
    argument of __ATOMIC_RELEASE, per the GCC documentation:
    
        https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/_005f_005fatomic-Builtins.html
    
    On Clang this generates a -Watomic-memory-ordering warning.
    
    Promote the fences in Acquire_Store() and Release_Load() to the stronger
    __ATOMIC_SEQ_CST memory model, which ought to be safe.
    
    Note that there are no actual uses of Acquire_Store() or Release_Load()
    in protobuf, though.
    
    This follows the TSAN atomicops implementation, which also uses SEQ_CST
    fences for these functions.
    
    (Fixes #25.)
    edmonds committed Sep 19, 2014
    Configuration menu
    Copy the full SHA
    cc0a047 View commit details
    Browse the repository at this point in the history