You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
802 B
30 lines
802 B
use std::sync::Arc;
|
|
|
|
use std::time::Duration;
|
|
|
|
use crate::asm::data::literal::Value;
|
|
use crate::runtime::program::Program;
|
|
use crate::runtime::run_thread::ThreadToken;
|
|
use crate::module::{CrsnExtension, CrsnUniq};
|
|
|
|
#[derive(Debug)]
|
|
pub struct ThreadInfo {
|
|
/// Thread ID
|
|
pub id: ThreadToken,
|
|
/// Initializer, used to generate unique IDs
|
|
pub(crate) uniq: Arc<CrsnUniq>,
|
|
/// Program to run
|
|
pub program: Arc<Program>,
|
|
/// Program to run
|
|
pub(crate) cycle_time: Duration,
|
|
/// Interval one thread/coroutine is let to run before the context switches
|
|
pub(crate) scheduler_interval: Duration,
|
|
/// Extensions
|
|
pub extensions: Arc<Vec<Box<dyn CrsnExtension>>>,
|
|
}
|
|
|
|
impl ThreadInfo {
|
|
pub fn unique_handle(&self) -> Value {
|
|
self.uniq.unique_handle()
|
|
}
|
|
}
|
|
|