mullvad / windows-service-rs

Windows services in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sync for ServiceStatusHandle

td202 opened this issue · comments

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.

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