Browse Source

Merge branch 'master' of https://github.com/tearshark/librf

tags/2.9.10
tearshark 4 years ago
parent
commit
e1c10f0cd6

tutorial/test_async_cinatra_client.cpp → benchmark/test_async_cinatra_client.cpp View File


+ 1
- 1
librf/src/state.inl View File

std::rethrow_exception(std::make_exception_ptr(future_exception{ error_code::not_ready })); std::rethrow_exception(std::make_exception_ptr(future_exception{ error_code::not_ready }));
break; break;
case result_type::Exception: case result_type::Exception:
std::rethrow_exception(std::move(this->_exception));
std::rethrow_exception(std::exchange(this->_exception, nullptr));
break; break;
default: default:
break; break;

+ 1
- 1
modern_cb

Subproject commit b3b4614af0a37cae4c903c86b4f234fc5f96c38e
Subproject commit 6c3135d07e1d935ea924f61a11307bf5e466dec9

+ 3
- 3
test_librf.cpp View File

extern void resumable_main_routine(); extern void resumable_main_routine();
extern void resumable_main_resumable(); extern void resumable_main_resumable();
extern void resumable_main_mutex(); extern void resumable_main_mutex();
extern void resumable_main_exception();
extern void resumable_main_exception(bool bomb);
extern void resumable_main_event(); extern void resumable_main_event();
extern void resumable_main_event_v2(); extern void resumable_main_event_v2();
extern void resumable_main_event_timeout(); extern void resumable_main_event_timeout();
(void)argc; (void)argc;
(void)argv; (void)argv;


//test_async_cinatra_client();
//resumable_main_exception(false);
//return 0; //return 0;


//if (argc > 1) //if (argc > 1)
resumable_main_yield_return(); resumable_main_yield_return();
resumable_main_resumable(); resumable_main_resumable();
resumable_main_routine(); resumable_main_routine();
resumable_main_exception();
resumable_main_exception(false);
resumable_main_dynamic_go(); resumable_main_dynamic_go();
resumable_main_multi_thread(); resumable_main_multi_thread();
resumable_main_timer(); resumable_main_timer();

+ 1
- 0
tutorial/test_async_cb.cpp View File

void resumable_main_cb() void resumable_main_cb()
{ {
std::cout << __FUNCTION__ << std::endl;
//由于使用者可能不能明确的区分是resume function返回的awaitor还是awaitable function返回的awaitor //由于使用者可能不能明确的区分是resume function返回的awaitor还是awaitable function返回的awaitor
//导致均有可能加入到协程里去调度。 //导致均有可能加入到协程里去调度。
//所以,协程调度器应该需要能处理这种情况。 //所以,协程调度器应该需要能处理这种情况。

+ 9
- 6
tutorial/test_async_exception.cpp View File

auto r = co_await async_signal_exception2(i); auto r = co_await async_signal_exception2(i);
std::cout << "result is " << r << std::endl; std::cout << "result is " << r << std::endl;
} }
catch (const std::exception& e)
catch (const std::exception& ex)
{ {
std::cout << "exception signal : " << e.what() << std::endl;
std::cout << "exception signal : " << ex.what() << std::endl;
} }
catch (...) catch (...)
{ {
} }
} }
void resumable_main_exception()
void resumable_main_exception(bool bomb)
{ {
std::cout << __FUNCTION__ << std::endl;
go test_signal_exception(); go test_signal_exception();
this_scheduler()->run_until_notask(); this_scheduler()->run_until_notask();
std::cout << std::endl; std::cout << std::endl;
go test_bomb_exception();
this_scheduler()->run_until_notask();
if (bomb)
{
go test_bomb_exception();
this_scheduler()->run_until_notask();
}
} }

+ 1
- 0
tutorial/test_async_modern_cb.cpp View File



void resumable_main_modern_cb() void resumable_main_modern_cb()
{ {
std::cout << __FUNCTION__ << std::endl;
example_future(); example_future();
example_librf(); example_librf();
} }

+ 1
- 0
tutorial/test_async_resumable.cpp View File

void resumable_main_resumable() void resumable_main_resumable()
{ {
std::cout << __FUNCTION__ << std::endl;
resumable_switch(1, 99); resumable_switch(1, 99);
resumable_switch(1, 0); resumable_switch(1, 0);

+ 1
- 0
tutorial/test_async_routine.cpp View File

void resumable_main_routine() void resumable_main_routine()
{ {
std::cout << __FUNCTION__ << std::endl;
//go test_routine_use_timer_2(); //go test_routine_use_timer_2();
#ifndef __GNUC__ //GCC: 没有提供__builtin_coro_frame这样的内置函数 #ifndef __GNUC__ //GCC: 没有提供__builtin_coro_frame这样的内置函数
go test_routine_use_timer(); go test_routine_use_timer();

+ 1
- 0
tutorial/test_async_suspend_always.cpp View File

void resumable_main_suspend_always() void resumable_main_suspend_always()
{ {
std::cout << __FUNCTION__ << std::endl;
go test_recursive_await(); go test_recursive_await();
go test_recursive_go(); go test_recursive_go();
this_scheduler()->run_until_notask(); this_scheduler()->run_until_notask();

+ 1
- 0
tutorial/test_async_yield_return.cpp View File

void resumable_main_yield_return() void resumable_main_yield_return()
{ {
std::cout << __FUNCTION__ << std::endl;
for (int i : test_yield_int()) for (int i : test_yield_int())
{ {
std::cout << i << " had return" << std::endl; std::cout << i << " had return" << std::endl;

+ 6
- 6
vs_proj/librf.vcxproj View File

</ClCompile> </ClCompile>
<ClCompile Include="..\benchmark\benchmark_async_mem.cpp" /> <ClCompile Include="..\benchmark\benchmark_async_mem.cpp" />
<ClCompile Include="..\benchmark\benchmark_channel_passing_next.cpp" /> <ClCompile Include="..\benchmark\benchmark_channel_passing_next.cpp" />
<ClCompile Include="..\benchmark\test_async_cinatra_client.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\librf\src\event_v1.cpp" /> <ClCompile Include="..\librf\src\event_v1.cpp" />
<ClCompile Include="..\librf\src\event_v2.cpp" /> <ClCompile Include="..\librf\src\event_v2.cpp" />
<ClCompile Include="..\librf\src\mutex_v1.cpp" /> <ClCompile Include="..\librf\src\mutex_v1.cpp" />
<ClCompile Include="..\tutorial\test_async_cb.cpp" /> <ClCompile Include="..\tutorial\test_async_cb.cpp" />
<ClCompile Include="..\tutorial\test_async_channel.cpp" /> <ClCompile Include="..\tutorial\test_async_channel.cpp" />
<ClCompile Include="..\tutorial\test_async_channel_mult_thread.cpp" /> <ClCompile Include="..\tutorial\test_async_channel_mult_thread.cpp" />
<ClCompile Include="..\tutorial\test_async_cinatra_client.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\tutorial\test_async_dynamic_go.cpp" /> <ClCompile Include="..\tutorial\test_async_dynamic_go.cpp" />
<ClCompile Include="..\tutorial\test_async_event.cpp" /> <ClCompile Include="..\tutorial\test_async_event.cpp" />
<ClCompile Include="..\tutorial\test_async_event_timeout.cpp" /> <ClCompile Include="..\tutorial\test_async_event_timeout.cpp" />

+ 2
- 2
vs_proj/librf.vcxproj.filters View File

<ClCompile Include="..\tutorial\test_async_stop_token.cpp"> <ClCompile Include="..\tutorial\test_async_stop_token.cpp">
<Filter>tutorial</Filter> <Filter>tutorial</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\tutorial\test_async_cinatra_client.cpp">
<Filter>tutorial</Filter>
<ClCompile Include="..\benchmark\test_async_cinatra_client.cpp">
<Filter>benchmark</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save