sandbox: Remove unnecessary thread

Don't create a thread to wait for the ttRPC server to end - it isn't
required as the operation should be blocked on.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2020-08-21 11:43:25 +01:00
parent d5fbba3b0a
commit 572de288f0

View File

@ -246,17 +246,9 @@ fn start_sandbox(logger: &Logger, config: &agentConfig) -> Result<()> {
//vsock:///dev/vsock, port
let mut server = rpc::start(sandbox.clone(), VSOCK_ADDR, VSOCK_PORT);
let handle = thread::spawn(move || {
// info!("Press ENTER to exit...");
// let _ = io::stdin().read(&mut [0]).unwrap();
// thread::sleep(Duration::from_secs(3000));
let _ = rx.recv().unwrap();
});
let _ = server.start().unwrap();
handle.join().unwrap();
let _ = rx.recv().map_err(|e| format!("{:?}", e));
server.shutdown();