On Mon, 2026-06-01 at 09:31 +0200, Nam Cao wrote:
> Nam Cao <[email protected]> writes:
> > Gabriele Monaco <[email protected]> writes:
> > > +static bool ha_mon_initializing;
> > 
> > The global variable makes me a bit uncomfortable (a quick google
> > will tell why this is not the best pattern).
> > 
> > I am sure there are better ways to differentiate when we are
> > initializing vs destroying. How about the incomplete sketch below?
> > I doubt it even builds, just give an idea.
> 
> Or instead of function pointer, we can also pass a bool flag whether
> the timer should be reset.

Good point, we could probably do a bit better than the current in
separating initialisation and destruction/reaction. I'm going to have a
thought.
We are also protecting against tasks where the monitor never started,
so they never got initialised before destruction. This makes it harder
to distinguish.

One thing to note is that we should probably keep the reset signature
constant as that's a member in struct rv_monitor. But that's probably
not a big issue.

Thanks,
Gabriele


Reply via email to