Skip to content

Commit

Permalink
Update samples from iox_queue to reader history cache in the
Browse files Browse the repository at this point in the history
read/take_impl APIs when SHM is supported and iox_listener is not
attached to a specific reader

Signed-off-by: Sumanth Nirmal <[email protected]>
  • Loading branch information
sumanth-nirmal committed Mar 8, 2022
1 parent 1761a27 commit 945ab91
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/core/ddsc/src/dds_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ static dds_return_t dds_read_impl (bool take, dds_entity_t reader_or_condition,

thread_state_awake (ts1, &entity->m_domain->gv);

#ifdef DDS_HAS_SHM
// If SHM is supported and if the monitor is not attached
if(rd->m_iox_sub && !rd->m_iox_sub_context.monitor) {
// transfer the samples from iox to rhc in the same thread context
dds_transfer_samples_from_iox_to_rhc(rd);
}
#endif

/* Allocate samples if not provided (assuming all or none provided) */
if (buf[0] == NULL)
{
Expand Down Expand Up @@ -163,6 +171,13 @@ static dds_return_t dds_readcdr_impl (bool take, dds_entity_t reader_or_conditio
}

thread_state_awake (ts1, &entity->m_domain->gv);
#ifdef DDS_HAS_SHM
// If SHM is supported and if the monitor is not attached
if(rd->m_iox_sub && !rd->m_iox_sub_context.monitor) {
// transfer the samples from iox to rhc in the same thread context
dds_transfer_samples_from_iox_to_rhc(rd);
}
#endif

/* read/take resets data available status -- must reset before reading because
the actual writing is protected by RHC lock, not by rd->m_entity.m_lock */
Expand Down

0 comments on commit 945ab91

Please sign in to comment.