5 #include <libcopp/utils/config/libcopp_build_features.h>
26 LIBCOPP_COTASK_NAMESPACE_BEGIN
58 EN_ECFT_COTASK = 0x0100,
59 EN_ECFT_MASK = 0xFF00,
72 LIBCOPP_COTASK_API
virtual ~
task_impl() = 0;
84 LIBCOPP_COTASK_API
virtual bool is_canceled()
const LIBCOPP_MACRO_NOEXCEPT;
85 LIBCOPP_COTASK_API virtual
bool is_completed()
const LIBCOPP_MACRO_NOEXCEPT;
86 LIBCOPP_COTASK_API virtual
bool is_faulted()
const LIBCOPP_MACRO_NOEXCEPT;
87 LIBCOPP_COTASK_API virtual
bool is_timeout()
const LIBCOPP_MACRO_NOEXCEPT;
95 LIBCOPP_COTASK_API
bool is_exiting()
const LIBCOPP_MACRO_NOEXCEPT;
98 LIBCOPP_COTASK_API virtual
int get_ret_code()
const = 0;
102 virtual
int yield(
void **priv_data) = 0;
103 virtual
int cancel(
void *priv_data) = 0;
114 LIBCOPP_COTASK_API
virtual int on_finished();
116 #if defined(LIBCOPP_MACRO_ENABLE_WIN_FIBER) && LIBCOPP_MACRO_ENABLE_WIN_FIBER
117 virtual bool is_fiber()
const LIBCOPP_MACRO_NOEXCEPT = 0;
135 LIBCOPP_COTASK_API
void _set_action(action_ptr_type
action);
136 LIBCOPP_COTASK_API action_ptr_type _get_action();
140 #if defined(LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR) && LIBCOPP_MACRO_ENABLE_STD_EXCEPTION_PTR
141 LIBCOPP_COTASK_API
int _notify_finished(std::list<std::exception_ptr> &unhandled,
void *priv_data);
143 LIBCOPP_COTASK_API
int _notify_finished(
void *priv_data);
154 #if !defined(LIBCOPP_DISABLE_ATOMIC_LOCK) || !(LIBCOPP_DISABLE_ATOMIC_LOCK)
155 LIBCOPP_COPP_NAMESPACE_ID::util::lock::atomic_int_type<uint32_t>
status_;
157 LIBCOPP_COPP_NAMESPACE_ID::util::lock::atomic_int_type<
158 LIBCOPP_COPP_NAMESPACE_ID::util::lock::unsafe_int_type<uint32_t> >
163 LIBCOPP_COTASK_NAMESPACE_END
atomic wrapper fo integers Licensed under the MIT licenses.
UTIL_FORCEINLINE int start()
id_allocator_type id_allocator_t
LIBCOPP_COPP_NAMESPACE_ID::util::lock::atomic_int_type< uint32_t > status_
LIBCOPP_COPP_NAMESPACE_ID::util::uint64_id_allocator id_allocator_type
UTIL_FORCEINLINE int resume()
task_impl & operator=(const task_impl &&)=delete
UTIL_FORCEINLINE int yield()
task_impl(const task_impl &)=delete
UTIL_FORCEINLINE action_ptr_type get_raw_action() const LIBCOPP_MACRO_NOEXCEPT
get raw action pointer
task_impl(const task_impl &&)=delete
LIBCOPP_COPP_NAMESPACE_ID::util::uint64_id_allocator::value_type id_type
UTIL_FORCEINLINE id_type get_id() const LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE EN_TASK_STATUS get_status() const LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE int cancel()
UTIL_FORCEINLINE int kill()
UTIL_FORCEINLINE int kill(void *priv_data)
UTIL_FORCEINLINE int kill(enum EN_TASK_STATUS status)
task_impl & operator=(const task_impl &)=delete
#define UTIL_SYMBOL_VISIBLE
锁管理器 Licensed under the MIT licenses.
LIBCOPP_COPP_API int yield(void **priv_data=nullptr) LIBCOPP_MACRO_NOEXCEPT
yield current coroutine
std::shared_ptr< cli::cmd_option_value > value_type
自旋锁 Licensed under the MIT licenses.