File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -66,18 +66,19 @@ pub fn start_port_mapping(
6666 if vec. is_empty ( ) {
6767 return Ok ( ( ) ) ;
6868 }
69- let runtime = tokio:: runtime:: Builder :: new_multi_thread ( )
70- . enable_all ( )
71- . thread_name ( "portMapping" )
72- . build ( ) ?;
73- runtime. block_on ( start_port_mapping0 ( vec) ) ?;
69+
7470 let ( sender, receiver) = tokio:: sync:: oneshot:: channel :: < ( ) > ( ) ;
7571 let worker = stop_manager. add_listener ( "portMapping" . into ( ) , move || {
7672 let _ = sender. send ( ( ) ) ;
7773 } ) ?;
7874 thread:: Builder :: new ( )
7975 . name ( "portMapping" . into ( ) )
8076 . spawn ( move || {
77+ let runtime = tokio:: runtime:: Builder :: new_multi_thread ( )
78+ . enable_all ( )
79+ . thread_name ( "portMapping" )
80+ . build ( ) . unwrap ( ) ;
81+ runtime. block_on ( start_port_mapping0 ( vec) ) . unwrap ( ) ;
8182 runtime. block_on ( async {
8283 let _ = receiver. await ;
8384 } ) ;
You can’t perform that action at this time.
0 commit comments