1
1

pmix3x: fix potential memory barrier bug with __atomic builtin atomics

See open-mpi/ompi#6014 for more information.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2018-11-06 10:37:14 -07:00
родитель 4008c46e84
Коммит 5efc76ef44

Просмотреть файл

@ -16,6 +16,8 @@
* Copyright (c) 2016-2017 Research Organization for Information Science * Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved. * Copyright (c) 2018 Intel, Inc. All rights reserved.
* Copyright (c) 2018 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -58,7 +60,14 @@ static inline void pmix_atomic_mb(void)
static inline void pmix_atomic_rmb(void) static inline void pmix_atomic_rmb(void)
{ {
#if OPAL_ASSEMBLY_ARCH == OPAL_X86_64
/* work around a bug in older gcc versions where ACQUIRE seems to get
* treated as a no-op instead of being equivalent to
* __asm__ __volatile__("": : :"memory") */
__atomic_thread_fence (__ATOMIC_SEQ_CST);
#else
__atomic_thread_fence (__ATOMIC_ACQUIRE); __atomic_thread_fence (__ATOMIC_ACQUIRE);
#endif
} }
static inline void pmix_atomic_wmb(void) static inline void pmix_atomic_wmb(void)