3 #include <libcopp/utils/config/libcopp_build_features.h>
21 LIBCOPP_COTASK_NAMESPACE_BEGIN
24 : action_(nullptr), id_(0), finish_priv_data_(nullptr), status_(
EN_TS_CREATED) {
27 id_ = id_alloc_.allocate();
31 assert(status_ <= EN_TS_CREATED || status_ >=
EN_TS_DONE);
36 id_alloc_.deallocate(
id_);
52 LIBCOPP_COPP_NAMESPACE_ID::coroutine_context_base *this_co =
53 LIBCOPP_COPP_NAMESPACE_ID::coroutine_context_base::get_this_coroutine_base();
54 if (
nullptr == this_co) {
62 return *
reinterpret_cast<task_impl **
>(this_co->get_private_buffer());
70 uint32_t expected_int = expected;
78 #if defined(LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR) && LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR
85 #if defined(LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR) && LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR
90 #if defined(LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR) && LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR
93 unhandled.emplace_back(std::current_exception());
101 LIBCOPP_COTASK_NAMESPACE_END
virtual int on_finished(task_impl &)
virtual LIBCOPP_COTASK_API bool is_timeout() const LIBCOPP_MACRO_NOEXCEPT
id_allocator_type id_allocator_t
LIBCOPP_COTASK_API bool is_exiting() const LIBCOPP_MACRO_NOEXCEPT
check if a cotask is exiting
virtual LIBCOPP_COTASK_API bool is_faulted() const LIBCOPP_MACRO_NOEXCEPT
LIBCOPP_COPP_NAMESPACE_ID::util::lock::atomic_int_type< uint32_t > status_
LIBCOPP_COTASK_API task_impl()
LIBCOPP_COTASK_API void _set_action(action_ptr_type action)
virtual LIBCOPP_COTASK_API bool is_canceled() const LIBCOPP_MACRO_NOEXCEPT
virtual LIBCOPP_COTASK_API int on_finished()
UTIL_FORCEINLINE EN_TASK_STATUS get_status() const LIBCOPP_MACRO_NOEXCEPT
LIBCOPP_COTASK_API action_ptr_type _get_action()
virtual LIBCOPP_COTASK_API ~task_impl()=0
virtual LIBCOPP_COTASK_API bool is_completed() const LIBCOPP_MACRO_NOEXCEPT
LIBCOPP_COTASK_API bool _cas_status(EN_TASK_STATUS &expected, EN_TASK_STATUS desired)
static LIBCOPP_COTASK_API task_impl * this_task()
LIBCOPP_COTASK_API int _notify_finished(void *priv_data)
@ COPP_EC_HAS_UNHANDLE_EXCEPTION
COPP_EC_CAST_FAILED.