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 <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-02-10 15:17:28 +01:00
parent 6646a766c5
commit e0e1e67f24

View file

@ -1746,12 +1746,14 @@ static int dds_rhc_read_w_qminv
++n; ++n;
} }
bool inst_became_old = false;
if (n > n_first && inst->isnew) if (n > n_first && inst->isnew)
{ {
inst_became_old = true;
inst->isnew = 0; inst->isnew = 0;
rhc->n_new--; rhc->n_new--;
} }
if (nread != inst_nread (inst)) if (nread != inst_nread (inst) || inst_became_old)
{ {
get_trigger_info (&post, inst, false); get_trigger_info (&post, inst, false);
if (update_conditions_locked (rhc, &pre, &post, NULL)) if (update_conditions_locked (rhc, &pre, &post, NULL))