mirror of
https://gitlab.com/niansa/libcrosscoro.git
synced 2025-03-06 20:53:32 +01:00
See issue for more details, in general attempting to implement a coro::thread_pool exposed that the coro::sync_wait and coro::when_all only worked if the coroutines executed on that same thread. They should now possibly have the ability to execute on another thread, to be determined in a later issue. Fixes #7
22 lines
No EOL
567 B
C++
22 lines
No EOL
567 B
C++
#include "catch.hpp"
|
|
|
|
#include <coro/coro.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
// TEST_CASE("thread_pool one worker, one task")
|
|
// {
|
|
// coro::thread_pool tp{1};
|
|
|
|
// auto func = [&tp]() -> coro::task<uint64_t>
|
|
// {
|
|
// std::cerr << "func()\n";
|
|
// co_await tp.schedule().value(); // Schedule this coroutine on the scheduler.
|
|
// std::cerr << "func co_return 42\n";
|
|
// co_return 42;
|
|
// };
|
|
|
|
// std::cerr << "coro::sync_wait(func()) start\n";
|
|
// coro::sync_wait(func());
|
|
// std::cerr << "coro::sync_wait(func()) end\n";
|
|
// }
|