15TEST(recurrent_shared_future, use_case) {
16 using namespace carla;
20 constexpr size_t number_of_threads = 12u;
21 constexpr size_t number_of_openings = 40u;
23 std::atomic_size_t count{0u};
24 std::atomic_bool done{
false};
28 auto result = future.
WaitFor(1s);
29 ASSERT_TRUE(result.has_value());
30 ASSERT_EQ(*result, 42);
35 std::this_thread::sleep_for(100ms);
36 for (
auto i = 0u; i < number_of_openings - 1u; ++i) {
38 std::this_thread::sleep_for(10ms);
43 ASSERT_EQ(count, number_of_openings * number_of_threads);