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

WIP for thread sanitizer improvement #2162

Open
wants to merge 9 commits into
base: releases/0.10.x
Choose a base branch
from
10 changes: 8 additions & 2 deletions src/core/ddsc/tests/topic_find_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ CU_Theory ((uint32_t num_local_pp, uint32_t num_remote_pp, uint32_t num_tp), dds

/* Start threads that create topics on local and remote participant] */
struct create_topic_thread_arg *create_args = ddsrt_malloc ((num_local_pp + num_remote_pp) * sizeof (*create_args));
ddsrt_thread_t *create_threads = ddsrt_malloc( (num_local_pp + num_remote_pp)* sizeof(ddsrt_thread_t));
for (uint32_t n = 0; n < num_local_pp + num_remote_pp; n++)
{
bool remote = n >= num_local_pp;
Expand All @@ -222,10 +223,9 @@ CU_Theory ((uint32_t num_local_pp, uint32_t num_remote_pp, uint32_t num_tp), dds
create_unique_topic_name ("ddsc_topic_find_global", create_args[n].topic_name_prefix, MAX_NAME_SIZE);
create_args[n].topic_desc = (n % 3) ? (n % 3 == 1 ? &Space_Type2_desc : &Space_Type3_desc) : &Space_Type1_desc;

ddsrt_thread_t thread_id;
ddsrt_threadattr_t thread_attr;
ddsrt_threadattr_init (&thread_attr);
ret = ddsrt_thread_create (&thread_id, "create_topic", &thread_attr, topics_thread, &create_args[n]);
ret = ddsrt_thread_create (&create_threads[n], "create_topic", &thread_attr, topics_thread, &create_args[n]);
CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK);
}

Expand Down Expand Up @@ -273,6 +273,12 @@ CU_Theory ((uint32_t num_local_pp, uint32_t num_remote_pp, uint32_t num_tp), dds
CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK);
}
ddsrt_free (create_args);

for (uint32_t n = 0; n < num_local_pp + num_remote_pp; n++)
{
uint32_t result;
ddsrt_thread_join(create_threads[n],&result);
}
}

CU_Test (ddsc_topic_find_global, same_name, .init = topic_find_global_init, .fini = topic_find_global_fini, .timeout = 30)
Expand Down
4 changes: 2 additions & 2 deletions src/core/ddsi/include/dds/ddsi/ddsi_proxy_endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ typedef int (*ddsi_filter_fn_t)(struct ddsi_writer *wr, struct ddsi_proxy_reader
struct ddsi_proxy_reader {
struct ddsi_entity_common e;
struct ddsi_proxy_endpoint_common c;
unsigned deleting: 1; /* set when being deleted */
uint8_t deleting; /* set when being deleted */
unsigned is_fict_trans_reader: 1; /* only true when it is certain that is a fictitious transient data reader (affects built-in topic generation) */
unsigned requests_keyhash: 1; /* 1 iff this reader would like to receive keyhashes */
unsigned redundant_networking: 1; /* 1 iff requests receiving data on all advertised interfaces */
uint8_t redundant_networking; /* 1 iff requests receiving data on all advertised interfaces */
#ifdef DDS_HAS_SSM
unsigned favours_ssm: 1; /* iff 1, this proxy reader favours SSM when available */
#endif
Expand Down
1 change: 0 additions & 1 deletion src/core/ddsi/src/ddsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ static ddsrt_socket_t ddsi_tcp_conn_handle (ddsi_tran_base_t base)
return ((ddsi_tcp_conn_t) base)->m_sock;
}

ddsrt_attribute_no_sanitize (("thread"))
static bool ddsi_tcp_supports (const struct ddsi_tran_factory *fact_cmn, int32_t kind)
{
struct ddsi_tran_factory_tcp * const fact = (struct ddsi_tran_factory_tcp *) fact_cmn;
Expand Down
1 change: 0 additions & 1 deletion src/core/ddsi/src/ddsi_tran.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ ddsi_tran_factory_t ddsi_factory_find (const struct ddsi_domaingv *gv, const cha
return ddsi_factory_find_with_len (gv, type, strlen (type));
}

ddsrt_attribute_no_sanitize (("thread"))
ddsi_tran_factory_t ddsi_factory_find_supported_kind (const struct ddsi_domaingv *gv, int32_t kind)
{
/* FIXME: MUST speed up */
Expand Down
Loading
Loading