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

Function scope_update_tree

src/scope.rs:1311–1327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1309
1310 THREAD_POOL.with_worker(|_: &Worker| {
1311 scope(|scope| {
1312 for _ in 0..NUM_JOBS {
1313 scope.spawn(|_: &Worker| {
1314 THREAD_POOL.join(
1315 |_| a.fetch_add(1, Ordering::Relaxed),
1316 |_| b.fetch_add(1, Ordering::Relaxed),
1317 );
1318 });
1319 }
1320 });
1321 });
1322
1323 assert_eq!(a.load(Ordering::Relaxed), NUM_JOBS);
1324 assert_eq!(b.load(Ordering::Relaxed), NUM_JOBS);
1325
1326 THREAD_POOL.depopulate();
1327 }
1328
1329 #[test]
1330 fn scope_nesting() {

Callers

nothing calls this directly

Calls 6

random_treeFunction · 0.85
resize_to_availableMethod · 0.80
with_workerMethod · 0.80
iterMethod · 0.80
updateMethod · 0.80
depopulateMethod · 0.80

Tested by

no test coverage detected