Skip to content
Snippets Groups Projects
Commit 139aded0 authored by Ruben Asplund's avatar Ruben Asplund
Browse files

Deleted out commented code

parent 04f32dd5
Branches
No related tags found
No related merge requests found
...@@ -217,72 +217,3 @@ fn longest_blocking(trace: &Trace, r: &str) -> u32 { ...@@ -217,72 +217,3 @@ fn longest_blocking(trace: &Trace, r: &str) -> u32 {
} }
return max_block; return max_block;
} }
/*
fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32 {
// Checks if the Task is claming a resource
if !tr.contains_key(&task.id) {
return 0;
}
// Find lower prio tasks that holds a resource
let mut lower_prio_tasks = HashSet::new();
for t in tasks {
if t.prio < task.prio && tr.contains_key(&t.id) {
lower_prio_tasks.insert(t.id.to_string());
}
}
if lower_prio_tasks.len() == 0 {
return 0;
}
let resources = &tr[&task.id];
println!("{:?}", tr);
println!("{:?}", resources);
// Checking every resource it holds
let mut max_block = 0;
let mut current_block = 0;
// Iterate through current task resources
for r1 in resources {
// Iterate through lower prio tasks
for t_id in &lower_prio_tasks {
let mut lower_prio_task_resources = &tr[t_id];
// Iterate through lower prio task resources
for r2 in lower_prio_task_resources {
// When current task use the same resource as a task
if r1 == r2 {
// Takes forward the blocking task
for t in tasks {
if &t.id == t_id {
// Iterate through first layer
for inner in &t.trace.inner {
if &inner.id == r2 {
current_block = inner.end.wrapping_sub(inner.start);
if max_block < current_block {
max_block = current_block;
}
}
// Iterate through second layer
for inner2 in &inner.inner {
if &inner2.id == r2 {
current_block = inner2.end.wrapping_sub(inner2.start);
if max_block < current_block {
max_block = current_block;
}
}
// Iterate through third layer
for inner3 in &inner2.inner {
current_block = inner2.end.wrapping_sub(inner2.start);
if max_block < current_block {
max_block = current_block;
}
}
}
}
}
}
}
}
}
}
return max_block;
}
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment