MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / loopWork

Method loopWork

Tests/Libraries/Await/AwaitTest.cpp:3037–3055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3035 SC_TEST_EXPECT(true);
3036#endif
3037 }
3038
3039 void loopWork()
3040 {
3041 ThreadPool threadPool;
3042 SC_TEST_EXPECT(threadPool.create(2));
3043
3044 AsyncEventLoop async;
3045 SC_TEST_EXPECT(async.create());
3046 SC_AWAIT_TEST_EVENT_LOOP(await, async);
3047
3048 Atomic<int> workCount = 0;
3049 AwaitTask task = loopWorkOnce(await, threadPool, workCount);
3050 SC_TEST_EXPECT(await.spawn(task));
3051 SC_TEST_EXPECT(await.run());
3052
3053 SC_TEST_EXPECT(task.result());
3054 SC_TEST_EXPECT(workCount.load() == 1);
3055 SC_TEST_EXPECT(async.close());
3056 SC_TEST_EXPECT(threadPool.destroy());
3057 }
3058

Callers 2

loopWorkOnceMethod · 0.45
loopWorkCancellableMethod · 0.45

Calls 7

spawnMethod · 0.80
resultMethod · 0.80
createMethod · 0.45
runMethod · 0.45
loadMethod · 0.45
closeMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected