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

Function scope_divide_and_conquer

src/scope.rs:1258–1279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1256 Poll::Ready(())
1257 } else {
1258 self.count += 1;
1259 cx.waker().wake_by_ref();
1260 Poll::Pending
1261 }
1262 }
1263 }
1264
1265 /// Tests that we can spawn futures onto a scope, and that the scope really
1266 /// does poll wait for the future to complete before returning.
1267 #[test]
1268 fn scope_pending_future() {
1269 static THREAD_POOL: ThreadPool = ThreadPool::new();
1270 THREAD_POOL.resize_to_available();
1271
1272 THREAD_POOL.scope(|scope| scope.spawn(CountFuture::default()));
1273
1274 THREAD_POOL.depopulate();
1275 }
1276
1277 /// Tests that a future that sleeps for a nontrivial amount of time does not
1278 /// cause the scope to exit early.
1279 #[test]
1280 fn scope_sleeping_future() {
1281 static THREAD_POOL: ThreadPool = ThreadPool::new();
1282 THREAD_POOL.resize_to_available();

Callers

nothing calls this directly

Calls 7

divide_and_conquerFunction · 0.85
divide_and_conquer_seqFunction · 0.85
resize_to_availableMethod · 0.80
with_workerMethod · 0.80
scopeMethod · 0.80
depopulateMethod · 0.80
spawnMethod · 0.45

Tested by

no test coverage detected