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

Function divide_and_conquer

src/scope.rs:1281–1297  ·  view source on GitHub ↗
(
        scope: &'scope Scope<'scope, 'env>,
        counter: &'scope AtomicUsize,
        size: usize,
    )

Source from the content-addressed store, hash-verified

1279 #[test]
1280 fn scope_sleeping_future() {
1281 static THREAD_POOL: ThreadPool = ThreadPool::new();
1282 THREAD_POOL.resize_to_available();
1283
1284 let mut complete = false;
1285 THREAD_POOL.scope(|scope| {
1286 scope.spawn(async {
1287 // Spawn a count future onto the thread pool, then have this
1288 // future sleep until that future is done.
1289 THREAD_POOL.spawn(CountFuture::default()).await;
1290 complete = true;
1291 })
1292 });
1293
1294 assert!(complete);
1295
1296 THREAD_POOL.depopulate();
1297 }
1298
1299 /// Tests that blocking functions like `join` can be nested within scopes.
1300 #[test]

Callers 1

scope_divide_and_conquerFunction · 0.85

Calls 1

spawnMethod · 0.45

Tested by 1

scope_divide_and_conquerFunction · 0.68