From 4cbfe5f90fb1c6111c0afa25165e4a5026924789 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 25 Mar 2021 10:54:22 +0800 Subject: [PATCH] services: log-server: use create_thread_1() This moves away from the deprecated `create_thread_simple()` call. Signed-off-by: Sean Cross --- services/log-server/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/log-server/src/main.rs b/services/log-server/src/main.rs index 8a5435169..b329dd591 100644 --- a/services/log-server/src/main.rs +++ b/services/log-server/src/main.rs @@ -224,7 +224,8 @@ fn handle_scalar( } } -fn reader_thread(mut output: implementation::OutputWriter) { +fn reader_thread(arg: usize) { + let mut output = unsafe { &mut *(arg as *mut implementation::OutputWriter) }; writeln!(output, "LOG: Xous Logging Server starting up...").unwrap(); writeln!(output, "LOG: ****************************************************************").unwrap(); @@ -331,10 +332,10 @@ fn some_main() -> ! { */ let mut output = implementation::init(); - let writer = output.get_writer(); + let mut writer = output.get_writer(); println!("LOG: my PID is {}", xous::process::id()); println!("LOG: Creating the reader thread"); - xous::create_thread_simple(reader_thread, writer).unwrap(); + xous::create_thread_1(reader_thread, &mut writer as *mut implementation::OutputWriter as usize).unwrap(); println!("LOG: Running the output"); output.run(); panic!("LOG: Exited");