@@ -232,13 +232,13 @@ namespace detail | |||
{ | |||
if constexpr (USE_LINK_QUEUE) | |||
{ | |||
return reinterpret_cast<state_read_t*>(_read_awakes.try_pop()); | |||
return _read_awakes.try_pop(); | |||
} | |||
else | |||
{ | |||
if (!_read_awakes.empty()) | |||
{ | |||
state_write_t* state = _read_awakes.front(); | |||
state_read_t* state = _read_awakes.front(); | |||
_read_awakes.pop_front(); | |||
return state; | |||
} | |||
@@ -251,7 +251,7 @@ namespace detail | |||
{ | |||
if constexpr (USE_LINK_QUEUE) | |||
{ | |||
return reinterpret_cast<state_write_t*>(_write_awakes.try_pop()); | |||
return _write_awakes.try_pop(); | |||
} | |||
else | |||
{ |
@@ -155,7 +155,7 @@ RESUMEF_NS | |||
return false; | |||
_state = new detail::state_mutex_t(); | |||
(void)_state->on_await_suspend(handler, parent->get_scheduler(), _root); | |||
_state->on_await_suspend(handler, parent->get_scheduler(), _root); | |||
_mutex->add_wait_list_lockless(_state.get()); | |||
@@ -20,9 +20,12 @@ RESUMEF_NS | |||
template<typename T> | |||
concept _AwaitorT = requires(T&& v) | |||
{ | |||
{ v.await_ready() } -> bool; | |||
{ v.await_ready() } ->bool; | |||
{ v.await_suspend(std::declval<std::experimental::coroutine_handle<promise_t<>>>()) }; | |||
{ v.await_resume() }; | |||
requires traits::is_valid_await_suspend_return_v< | |||
decltype(v.await_suspend(std::declval<std::experimental::coroutine_handle<promise_t<>>>())) | |||
>; | |||
}; | |||
template<typename T> |
@@ -43,12 +43,9 @@ int main(int argc, const char* argv[]) | |||
//test_ring_queue<resumef::ring_queue_spinlock<int, false, uint32_t>>(); | |||
//test_ring_queue<resumef::ring_queue_lockfree<int, uint64_t>>(); | |||
//resumable_main_event_v2(); | |||
//resumable_main_event(); | |||
//resumable_main_event_timeout(); | |||
//resumable_main_sleep(); | |||
//resumable_main_resumable(); | |||
//return 0; | |||
resumable_main_channel_mult_thread(); | |||
resumable_main_channel(); | |||
return 0; | |||
//if (argc > 1) | |||
// resumable_main_benchmark_asio_client(atoi(argv[1])); |
@@ -40,13 +40,13 @@ | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |||
<ConfigurationType>Application</ConfigurationType> | |||
<PlatformToolset>ClangCL</PlatformToolset> | |||
<PlatformToolset>v142</PlatformToolset> | |||
<UseDebugLibraries>true</UseDebugLibraries> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |||
<ConfigurationType>Application</ConfigurationType> | |||
<UseDebugLibraries>false</UseDebugLibraries> | |||
<PlatformToolset>ClangCL</PlatformToolset> | |||
<PlatformToolset>v142</PlatformToolset> | |||
<WholeProgramOptimization>true</WholeProgramOptimization> | |||
<CharacterSet>NotSet</CharacterSet> | |||
</PropertyGroup> |