pub fn spawn_kthread<S, F>(name: S, fun: F) -> Id
    where S: Into<String>, F: FnOnce() + Send + 'static {

    let subproc = kernel().lock().create_subprocess();

    let id;

    {
        let mut subproc = subproc.lock();

        id = subproc.id();

        subproc.set_name(name);

        unsafe {
            let boxed_fun = Box::into_raw(Box::new(Box::new(fun) as BoxedFun));

            subproc.load_kernel_fn(kthread_entry, boxed_fun as usize);
        }

        subproc.run();
    }

    scheduler::push(subproc);

    id
}
/// Spawn a kernel thread using Rust code.
Spawn a kernel thread using Rust code.
Spawn a kernel thread using Rust code .
pub fn spawn_kthread<S, F>(name: S, fun: F) -> Id
    where S: Into<String>, F: FnOnce() + Send + 'static {
    let subproc = kernel().lock().create_subprocess();
    let id;
    {
        let mut subproc = subproc.lock();
        id = subproc.id();
        subproc.set_name(name);
        unsafe {
            let boxed_fun = Box::into_raw(Box::new(Box::new(fun) as BoxedFun));
            subproc.load_kernel_fn(kthread_entry, boxed_fun as usize);
        }
        subproc.run();
    }
    scheduler::push(subproc);
    id
}
pub fn spawn_kthread < S , F > ( name : S , fun : F ) -> Id where S : Into < String > , F : FnOnce ( ) + Send + ' static { let subproc = kernel ( ) . lock ( ) . create_subprocess ( ) ; let id ; { let mut subproc = subproc . lock ( ) ; id = subproc . id ( ) ; subproc . set_name ( name ) ; unsafe { let boxed_fun = Box :: into_raw ( Box :: new ( Box :: new ( fun ) as BoxedFun ) ) ; subproc . load_kernel_fn ( kthread_entry , boxed_fun as usize ) ; } subproc . run ( ) ; } scheduler :: push ( subproc ) ; id }
Spawn a kernel thread using Rust code.
Spawn a kernel thread using Rust code .
name
S
fun
F