From 6ca0bcaaf7c088d8b99f636c972a03267b79cbbc Mon Sep 17 00:00:00 2001 From: Ben Franksen <ben.franksen@online.de> Date: Tue, 10 Apr 2012 17:03:59 +0000 Subject: [PATCH] seq: emulate the 'first monitor event' for anonymous PVs in safe mode This is done by setting all event flags that have anonymous PVs sync'ed to them, once right after all named (real) PVs have connected. --- src/seq/seq_task.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/seq/seq_task.c b/src/seq/seq_task.c index a36f8267..0fdf379e 100644 --- a/src/seq/seq_task.c +++ b/src/seq/seq_task.c @@ -65,6 +65,15 @@ void sequencer (void *arg) /* ptr to original (global) state program table */ if (seq_connect(sp, ((sp->options & OPT_CONN) != 0)) != pvStatOK) goto exit; + /* Emulate the 'first monitor event' for anonymous PVs */ + if ((sp->options & OPT_SAFE) != 0) + { + unsigned nch; + for (nch=0; nch<sp->numChans; nch++) + if (sp->chan[nch].syncedTo && !sp->chan[nch].dbch) + seq_efSet(sp->ss, sp->chan[nch].syncedTo); + } + /* Call program entry function if defined. Treat as if called from 1st state set. */ if (sp->entryFunc) sp->entryFunc(sp->ss, sp->ss->var); -- GitLab