You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: exec.rs
    path of file: ./repos/occlum/src/libos/src/process/task
    
    the code of the file until where you have to start completion: use super::super::{current, TermStatus, ThreadRef};
use super::Task;
use crate::interrupt;
use crate::prelude::*;

/// Enqueue a new thread so that it can be executed later.
pub fn enqueue(new_
    
pub fn exec(libos_tid: pid_t, host_tid: pid_t) -> Result<i32> {
    let this_thread: ThreadRef = dequeue(libos_tid)?;
    this_thread.start(host_tid);

    // Enable current::get() from now on
    current::set(this_thread.clone());

    interrupt::enable_current_thread();

    unsafe {
        // task may only be modified by this function; so no lock is needed
        do_exec_task(this_thread.task() as *const Task as *mut Task);
    }

    interrupt::disable_current_thread();

    let term_status = this_thread.inner().term_status().unwrap();
    match term_status {
        TermStatus::Exited(status) => {
            info!("Thread exited: tid = {}, status = {}", libos_tid, status);
        }
        TermStatus::Killed(signum) => {
            info!("Thread killed: tid = {}, signum = {:?}", libos_tid, signum);
        }
    }

    // Disable current::get()
    current::reset();

    Ok(term_status.as_u32() as i32)
}