Sync for ServiceStatusHandle
td202 opened this issue · comments
Thomas Dinsdale-Young commented
ServiceStatusHandle
is already Send
, but it seems it could also be Sync
, since the SetServiceStatus
API is thread-safe. This could be useful, for instance, to allow the service control handler to set a pending state, asynchronously signal the main thread, and return.
Andrej Mihajlov commented
Agree. Right now we allow it to be cloned, but I see no reason why we shouldn't share it across threads. Please feel free to send a PR.
https://github.com/mullvad/windows-service-rs/blob/master/src/service_control_handler.rs#L35