From aa498b9b410445aac83b4fefbab4fd981f989b79 Mon Sep 17 00:00:00 2001 From: "Samuel K. Gutierrez" Date: Wed, 19 Apr 2023 17:14:43 -0600 Subject: [PATCH] Silence TSan data race warning. Signed-off-by: Samuel K. Gutierrez --- src/include/prte_stdatomic.h | 4 ++++ src/mca/oob/tcp/oob_tcp_component.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/include/prte_stdatomic.h b/src/include/prte_stdatomic.h index 94a87b4b3d..725692f0c3 100644 --- a/src/include/prte_stdatomic.h +++ b/src/include/prte_stdatomic.h @@ -7,6 +7,7 @@ * Copyright (c) 2021 Nanook Consulting. All rights reserved. * Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights * reserved. + * Copyright (c) 2023 Triad National Security, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,6 +19,7 @@ # define PRTE_STDATOMIC_H # include "prte_stdint.h" +# include # if PRTE_ATOMIC_C11 @@ -26,6 +28,7 @@ typedef atomic_int prte_atomic_int_t; typedef atomic_long prte_atomic_long_t; +typedef _Atomic bool prte_atomic_bool_t; typedef _Atomic int32_t prte_atomic_int32_t; typedef _Atomic uint32_t prte_atomic_uint32_t; typedef _Atomic int64_t prte_atomic_int64_t; @@ -41,6 +44,7 @@ typedef _Atomic uintptr_t prte_atomic_uintptr_t; typedef volatile int prte_atomic_int_t; typedef volatile long prte_atomic_long_t; +typedef volatile bool prte_atomic_bool_t; typedef volatile int32_t prte_atomic_int32_t; typedef volatile uint32_t prte_atomic_uint32_t; typedef volatile int64_t prte_atomic_int64_t; diff --git a/src/mca/oob/tcp/oob_tcp_component.h b/src/mca/oob/tcp/oob_tcp_component.h index 4a824fd18e..9131e100fb 100644 --- a/src/mca/oob/tcp/oob_tcp_component.h +++ b/src/mca/oob/tcp/oob_tcp_component.h @@ -18,6 +18,7 @@ * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights * reserved. * Copyright (c) 2021-2022 Nanook Consulting. All rights reserved. + * Copyright (c) 2023 Triad National Security, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,6 +35,7 @@ # include #endif +#include "src/include/prte_stdatomic.h" #include "src/class/pmix_bitmap.h" #include "src/class/pmix_list.h" #include "src/class/pmix_pointer_array.h" @@ -79,7 +81,7 @@ typedef struct { int num_hnp_ports; /**< number of ports the HNP should listen on */ pmix_list_t listeners; /**< List of sockets being monitored by event or thread */ pmix_thread_t listen_thread; /**< handle to the listening thread */ - bool listen_thread_active; + prte_atomic_bool_t listen_thread_active; struct timeval listen_thread_tv; /**< Timeout when using listen thread */ int stop_thread[2]; /**< pipe used to exit the listen thread */ int keepalive_probes; /**< number of keepalives that can be missed before declaring error */