Add multithreading to rust code.

This commit is contained in:
Drew Galbraith 2024-07-28 19:02:03 -07:00
parent 19144f7be9
commit d5a5041c4b
5 changed files with 76 additions and 6 deletions

View file

@ -9,6 +9,7 @@ use mammoth::debug;
use mammoth::define_entry;
use mammoth::syscall::debug;
use mammoth::syscall::z_err_t;
use mammoth::thread;
use yellowstone::GetEndpointRequest;
use yellowstone::YellowstoneClient;
@ -41,5 +42,12 @@ pub extern "C" fn main() -> z_err_t {
debug!("Got endpoint w/ cap: {:#x}", endpoint.endpoint);
let e: thread::ThreadEntry = |_| {
debug!("Testing 1 2 3");
};
let t = thread::Thread::spawn(&e, core::ptr::null());
t.join().expect("Failed to wait.");
0
}