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

Method update_in_scope

src/scope.rs:1350–1368  ·  view source on GitHub ↗
(
            &'env mut self,
            scope: &'scope Scope<'scope, 'env>,
            op: &'scope OP,
        )

Source from the content-addressed store, hash-verified

1348 THREAD_POOL.depopulate();
1349 }
1350
1351 /// Tests that nesting two scopes on different workers will not deadlock.
1352 #[test]
1353 fn scope_nesting_new_worker() {
1354 static THREAD_POOL: ThreadPool = ThreadPool::new();
1355 THREAD_POOL.resize_to_available();
1356
1357 let mut completed = false;
1358
1359 THREAD_POOL.with_worker(|worker| {
1360 worker.scope(|scope| {
1361 scope.spawn(|_: &Worker| {
1362 // Creating a new worker instead of reusing the old one is
1363 // bad form, but we may as well test it.
1364 THREAD_POOL.with_worker(|worker| {
1365 worker.scope(|scope| {
1366 scope.spawn(|_: &Worker| {
1367 completed = true;
1368 });
1369 });
1370 });
1371 });

Callers 1

updateMethod · 0.80

Calls 1

spawnMethod · 0.45

Tested by

no test coverage detected