From 139aded0c30741d8f3ef91fc6aab44f3082c953e Mon Sep 17 00:00:00 2001 From: rubenasplund <ruben.asplund@hotmail.com> Date: Tue, 12 Jan 2021 18:30:06 +0100 Subject: [PATCH] Deleted out commented code --- srp_analysis/src/main.rs | 71 +--------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/srp_analysis/src/main.rs b/srp_analysis/src/main.rs index ff78ef1..9677550 100644 --- a/srp_analysis/src/main.rs +++ b/srp_analysis/src/main.rs @@ -216,73 +216,4 @@ fn longest_blocking(trace: &Trace, r: &str) -> u32 { } } 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 +} \ No newline at end of file -- GitLab