File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
tests/libs/services/tests Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -209,10 +209,15 @@ impl<'a> Service<'a> {
209209 drop ( writer) ;
210210
211211 unsafe {
212- SetServiceStatus ( * self . handle . read ( ) . unwrap ( ) , & status) ;
212+ SetServiceStatus ( self . handle ( ) , & status) ;
213213 }
214214 }
215215
216+ /// The raw handle representing the service.
217+ pub fn handle ( & self ) -> * mut core:: ffi:: c_void {
218+ * self . handle . read ( ) . unwrap ( )
219+ }
220+
216221 /// The current state the service.
217222 pub fn state ( & self ) -> State {
218223 let reader = self . status . read ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ fn start_stop() {
77
88 Service :: new ( )
99 . can_fallback ( |_| { } )
10- . run ( |_, command| {
10+ . run ( |service, command| {
11+ assert ! ( service. handle( ) . is_null( ) ) ;
1112 log. push ( command) ;
1213 } )
1314 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments