(counter: &AtomicUsize, size: usize)
| 1297 | } |
| 1298 | |
| 1299 | /// Tests that blocking functions like `join` can be nested within scopes. |
| 1300 | #[test] |
| 1301 | fn scope_concurrency() { |
| 1302 | const NUM_JOBS: u8 = 128; |
| 1303 | |
| 1304 | static THREAD_POOL: ThreadPool = ThreadPool::new(); |
| 1305 | THREAD_POOL.resize_to_available(); |
| 1306 | |
| 1307 | let a = AtomicU8::new(0); |
| 1308 | let b = AtomicU8::new(0); |
| 1309 | |
| 1310 | THREAD_POOL.with_worker(|_: &Worker| { |
no outgoing calls