Notifier not stopping

Is anyone else seeing issues with Notifiers when trying to stop them?

When stop() is called on a notifier it doesn’t seem to be actually stopping and continues to loop.

@Thad_House thanks for the assist today. Assuming this will be out in the next WPILib release?

1 Like

Hopefully. As a temp fix for now, you can add a bool, set that bool to false in end before calling stop, and then in the callback check if that bool is false, and if so call stop from the callback. That is safe, and that will work around the race condition.

So call stop from inside the method that the notifier is calling?

Actually, thinking about it more that won’t work either, that still has the race.

But, I have another way to solve the issue. In end, before calling stop, call startSingle with a relatively high period, and then call stop. That might call once after returning, but will make sure it’s stopped after that.

Looks like the fix went out in

Thanks again.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.