rusty-jvm 0.5.0

An implementation of a Java Virtual Machine (JVM).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::vm::error::Result;
use crate::vm::method_area::method_area::with_method_area;

pub(crate) fn current_thread_wrp(_args: &[i32]) -> Result<Vec<i32>> {
    let result = current_thread()?;

    Ok(vec![result])
}
fn current_thread() -> Result<i32> {
    let thread_id = with_method_area(|method_area| {
        method_area.system_thread_id() // since we do not spawn threads, primordial system thread is returned here
    })?;
    Ok(thread_id)
}