Re: My service crashes during shutdown

Tech-Archive recommends: Speed Up your PC by fixing your registry




> Right now when I receive SERVICE_CONTROL_STOP I tell my service thread
> to stop (what takes some time), set status to SERVICE_STOP_PENDING and
> return from service control function.
> In other words the service control function returns before the service
> thread finishes.
> Can this be a source of a problem?

Probably not (unless there is a race condition specific to the implementation
of this particular server).

> Should I force service control function to wait until service thread is
> done?
>

No, it is not necessary. It is enough to notify the service thread
that it should stop.

Regards,
Oleg
[VC++ MVP]





.