| 1626 | }) |
| 1627 | }); |
| 1628 | |
| 1629 | THREAD_POOL.depopulate(); |
| 1630 | } |
| 1631 | |
| 1632 | /// Tests that work spawned after a panicking job still completes. |
| 1633 | #[test] |
| 1634 | #[cfg_attr(not(panic = "unwind"), ignore)] |
| 1635 | fn scope_panic_propagate_still_execute_after() { |
| 1636 | static THREAD_POOL: ThreadPool = ThreadPool::new(); |
| 1637 | THREAD_POOL.resize_to_available(); |
| 1638 | |
| 1639 | let mut x = false; |
| 1640 | let result = unwind::halt_unwinding(|| { |
| 1641 | THREAD_POOL.scope(|scope| { |
| 1642 | scope.spawn(|_: &Worker| panic!("Hello, world!")); // job A |