From e0e1e67f2481c1b84f9df848a560d8842ac7a0cb Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Sun, 10 Feb 2019 15:17:28 +0100 Subject: [PATCH] read condition on view "old" not triggered when reading only "read" samples A read restricted to samples in "read" state would not enter the condition update code on the false assumption that no read conditions could become triggered if the number of read samples remained the same, but it is nonetheless possible that the instance was transitions from "new" to "old" as a consequence, at least in my interpretation of the spec and the current implementation of read() in Cyclone. This commit brings consistency to the implementation without the intention of confirming the current behaviour as being desirable. Signed-off-by: Erik Boasson --- src/core/ddsc/src/dds_rhc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/ddsc/src/dds_rhc.c b/src/core/ddsc/src/dds_rhc.c index 75df030..09273fc 100644 --- a/src/core/ddsc/src/dds_rhc.c +++ b/src/core/ddsc/src/dds_rhc.c @@ -1746,12 +1746,14 @@ static int dds_rhc_read_w_qminv ++n; } + bool inst_became_old = false; if (n > n_first && inst->isnew) { + inst_became_old = true; inst->isnew = 0; rhc->n_new--; } - if (nread != inst_nread (inst)) + if (nread != inst_nread (inst) || inst_became_old) { get_trigger_info (&post, inst, false); if (update_conditions_locked (rhc, &pre, &post, NULL))