@@ -17,7 +17,6 @@ limitations under the License.
1717use hyperlight_common:: flatbuffer_wrappers:: function_types:: { ParameterValue , ReturnType } ;
1818use tracing:: { span, Level } ;
1919extern crate hyperlight_host;
20- use std:: sync:: { Arc , Mutex } ;
2120use std:: thread:: { spawn, JoinHandle } ;
2221
2322use hyperlight_host:: sandbox:: uninitialized:: UninitializedSandbox ;
@@ -60,7 +59,6 @@ fn run_example() -> Result<()> {
6059
6160 for i in 0 ..10 {
6261 let path = hyperlight_guest_path. clone ( ) ;
63- let writer_func = Arc :: new ( Mutex :: new ( fn_writer) ) ;
6462 let handle = spawn ( move || -> Result < ( ) > {
6563 // Construct a new span named "hyperlight tracing example thread" with INFO level.
6664 let id = Uuid :: new_v4 ( ) ;
@@ -73,12 +71,8 @@ fn run_example() -> Result<()> {
7371 let _entered = span. enter ( ) ;
7472
7573 // Create a new sandbox.
76- let usandbox = UninitializedSandbox :: new (
77- GuestBinary :: FilePath ( path) ,
78- None ,
79- None ,
80- Some ( & writer_func) ,
81- ) ?;
74+ let mut usandbox = UninitializedSandbox :: new ( GuestBinary :: FilePath ( path) , None , None ) ?;
75+ usandbox. register_print ( fn_writer) ?;
8276
8377 // Initialize the sandbox.
8478
@@ -119,7 +113,6 @@ fn run_example() -> Result<()> {
119113 GuestBinary :: FilePath ( hyperlight_guest_path. clone ( ) ) ,
120114 None ,
121115 None ,
122- None ,
123116 ) ?;
124117
125118 // Initialize the sandbox.
0 commit comments