MCPcopy Create free account
hub / github.com/NthTensor/Forte / scope_panic_propagate_still_execute_before

Function scope_panic_propagate_still_execute_before

src/scope.rs:1533–1550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1531 THREAD_POOL.with_worker(|_| {
1532 let mut max_diff = Mutex::new(0);
1533 let bottom_of_stack = 0;
1534 scope(|s| the_final_countdown(s, &bottom_of_stack, &max_diff, 5));
1535 let diff_when_5 = *max_diff.get_mut().unwrap() as f64;
1536
1537 scope(|s| the_final_countdown(s, &bottom_of_stack, &max_diff, 500));
1538 let diff_when_500 = *max_diff.get_mut().unwrap() as f64;
1539
1540 let ratio = diff_when_5 / diff_when_500;
1541 assert!(
1542 ratio > 0.9 && ratio < 1.1,
1543 "stack usage ratio out of bounds: {ratio}"
1544 );
1545 });
1546
1547 THREAD_POOL.depopulate();
1548 }
1549
1550 fn the_final_countdown<'scope, 'env>(
1551 scope: &'scope Scope<'scope, 'env>,
1552 bottom_of_stack: &'scope i32,
1553 max: &'scope Mutex<usize>,

Callers

nothing calls this directly

Calls 5

halt_unwindingFunction · 0.85
resize_to_availableMethod · 0.80
scopeMethod · 0.80
depopulateMethod · 0.80
spawnMethod · 0.45

Tested by

no test coverage detected