I’ve had some hang-ups on shutdown and have been through a few iterations on working out what is happening.

 

I then realised there was the whole  MyBoot.ShutdownPending thing which would be the proper way to do waiting for shut-down.

 

I’m mostly read to submit for that… but one small thing was that I have been conditionally creating the poller thread and queue and that has potential race-condition problems.  I can definitely solve that using the poller crit section and some atomic operations…

 

However, I’m thinking that maybe I should create the poller Task and poller queue unconditionally in the constructor?  Any objections? It would certainly remove the whole race condition. I had the best intentions of making it conditional.. but now the act of creating any Vehicle class starts the poller, it seems a bit pointless.

 

//.ichael