Go to the documentation of this file.
10 void (*task_func)(
void *),
void *arg,
59 #ifndef ABT_CONFIG_ENABLE_VER_20_API
70 int refcount = (newtask != NULL) ? 1 : 0;
71 int abt_errno =
task_create(p_global, p_local, p_pool, task_func, arg, NULL,
72 refcount, &p_newtask);
123 #ifndef ABT_CONFIG_ENABLE_VER_20_API
137 int refcount = (newtask != NULL) ? 1 : 0;
138 int abt_errno =
task_create(p_global, p_local, p_pool, task_func, arg, NULL,
139 refcount, &p_newtask);
264 #ifndef ABT_CONFIG_ENABLE_VER_20_API
313 #ifndef ABT_CONFIG_ENABLE_VER_20_API
464 #ifdef ABT_CONFIG_USE_DOXYGEN
525 #ifdef ABT_CONFIG_USE_DOXYGEN
539 #ifdef ABT_CONFIG_USE_DOXYGEN
559 void (*task_func)(
void *),
void *arg,
579 p_newtask->
p_arg = arg;
587 #ifndef ABT_CONFIG_DISABLE_MIGRATION
590 p_newtask->
type |= thread_type;
604 *pp_newtask = p_newtask;
ABT_task_state
State of a tasklet.
@ ABT_THREAD_STATE_TERMINATED
struct ABT_key_opaque * ABT_key
Work-unit-specific data key handle type.
#define ABT_ERR_INV_THREAD
Error code: invalid work unit.
int ABT_thread_get_arg(ABT_thread thread, void **arg) ABT_API_PUBLIC
Retrieve an argument for a work-unit function of a work unit.
int ABT_bool
Boolean type.
int ABT_task_set_specific(ABT_task task, ABT_key key, void *value)
Set a value with a work-unit-specific key in a work unit.
int ABT_task_cancel(ABT_task task)
Send a termination request to a work unit.
#define ABTI_SETUP_LOCAL_XSTREAM(pp_local_xstream)
int ABT_task_self_id(ABT_unit_id *id)
Get ID of the calling work unit.
int ABT_task_self(ABT_task *task)
Get the calling work unit.
struct ABT_thread_opaque * ABT_task
Work unit handle type.
int ABT_task_get_last_pool_id(ABT_task task, int *id)
Get the last pool's ID of a work unit.
#define ABTI_SETUP_GLOBAL(pp_global)
@ ABT_TASK_STATE_TERMINATED
static ABTI_global * ABTI_global_get_global(void)
int ABT_thread_set_migratable(ABT_thread thread, ABT_bool migratable) ABT_API_PUBLIC
Set the migratability in a work unit.
#define ABTI_CHECK_ERROR(abt_errno)
static ABTU_ret_err int ABTI_mem_alloc_nythread(ABTI_local *p_local, ABTI_thread **pp_thread)
int ABT_thread_get_id(ABT_thread thread, ABT_unit_id *thread_id) ABT_API_PUBLIC
Get ID of a work unit.
#define ABTI_THREAD_TYPE_YIELDABLE
ABTD_atomic_uint32 request
ABT_unit_id ABTI_thread_get_id(ABTI_thread *p_thread)
static void ABTI_pool_push(ABTI_pool *p_pool, ABT_unit unit)
static ABT_thread ABTI_thread_get_handle(ABTI_thread *p_thread)
#define ABTI_IS_ERROR_CHECK_ENABLED
int ABT_thread_get_state(ABT_thread thread, ABT_thread_state *state) ABT_API_PUBLIC
Get a state of a work unit.
struct ABT_pool_opaque * ABT_pool
Pool handle type.
static ABTU_ret_err int task_create(ABTI_global *p_global, ABTI_local *p_local, ABTI_pool *p_pool, void(*task_func)(void *), void *arg, ABTI_sched *p_sched, int refcount, ABTI_thread **pp_newtask)
ABT_thread_state
State of a work unit.
int ABT_thread_free(ABT_thread *thread) ABT_API_PUBLIC
Free a work unit.
static void ABTI_mem_free_nythread(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
int ABT_task_get_arg(ABT_task task, void **arg)
Retrieve an argument for a work-unit function of a work unit.
int ABT_task_create_on_xstream(ABT_xstream xstream, void(*task_func)(void *), void *arg, ABT_task *newtask)
Create a new tasklet associated with an execution stream.
static void ABTD_atomic_relaxed_store_uint32(ABTD_atomic_uint32 *ptr, uint32_t val)
uint64_t ABT_unit_id
Work unit ID type.
struct ABT_xstream_opaque * ABT_xstream
Execution stream handle type.
int ABT_task_is_unnamed(ABT_task task, ABT_bool *flag)
Check if a work unit is unnamed.
int ABT_thread_get_last_pool(ABT_thread thread, ABT_pool *pool) ABT_API_PUBLIC
Get the last pool of a work unit.
#define ABTI_HANDLE_ERROR(n)
#define LOG_DEBUG(fmt,...)
#define ABTI_THREAD_TYPE_MIGRATABLE
static void ABTD_atomic_relaxed_store_int(ABTD_atomic_int *ptr, int val)
int ABT_thread_join(ABT_thread thread) ABT_API_PUBLIC
Wait for a work unit to terminate.
#define ABTI_THREAD_TYPE_THREAD
int ABT_task_revive(ABT_pool pool, void(*task_func)(void *), void *arg, ABT_task *task)
Revive a terminated work unit.
int ABT_task_free(ABT_task *task)
Free a work unit.
static ABTI_local * ABTI_local_get_local(void)
#define ABT_ERR_INV_TASK
Error code: invalid work unit.
static ABTI_pool * ABTI_xstream_get_main_pool(ABTI_xstream *p_xstream)
#define ABT_SUCCESS
Error code: the routine returns successfully.
int ABT_thread_get_last_xstream(ABT_thread thread, ABT_xstream *xstream) ABT_API_PUBLIC
Get an execution stream associated with a work unit.
static ABTI_xstream * ABTI_local_get_xstream_or_null(ABTI_local *p_local)
uint32_t ABTI_thread_type
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
int ABT_task_get_id(ABT_task task, ABT_unit_id *task_id)
Get ID of a work unit.
int ABT_thread_is_migratable(ABT_thread thread, ABT_bool *is_migratable) ABT_API_PUBLIC
Get the migratability of a work unit.
int ABT_task_get_last_pool(ABT_task task, ABT_pool *pool)
Get the last pool of a work unit.
#define ABTI_CHECK_NULL_POOL_PTR(p)
#define ABTI_CHECK_NULL_XSTREAM_PTR(p)
#define ABTI_THREAD_TYPE_NAMED
int ABT_task_create(ABT_pool pool, void(*task_func)(void *), void *arg, ABT_task *newtask)
Create a new tasklet.
static ABTI_xstream * ABTI_xstream_get_ptr(ABT_xstream xstream)
ABTI_xstream * p_last_xstream
int ABT_task_equal(ABT_task task1, ABT_task task2, ABT_bool *result)
Compare two work-unit handles for equality.
ABTD_atomic_ptr p_keytable
struct ABTI_local ABTI_local
int ABT_task_get_state(ABT_task task, ABT_task_state *state)
Get a state of a tasklet.
int ABT_task_set_migratable(ABT_task task, ABT_bool flag)
Set the migratability in a work unit.
int ABT_task_get_specific(ABT_task task, ABT_key key, void **value)
Get a value associated with a work-unit-specific key in a work unit.
int ABT_task_get_xstream(ABT_task task, ABT_xstream *xstream)
Get an execution stream associated with a work unit.
int ABT_thread_get_last_pool_id(ABT_thread thread, int *id) ABT_API_PUBLIC
Get the last pool's ID of a work unit.
#define ABTI_CHECK_TRUE(cond, abt_errno)
int ABT_thread_revive(ABT_pool pool, void(*thread_func)(void *), void *arg, ABT_thread *thread) ABT_API_PUBLIC
Revive a terminated work unit.
int ABT_thread_equal(ABT_thread thread1, ABT_thread thread2, ABT_bool *result) ABT_API_PUBLIC
Compare two work unit handles for equality.
static void ABTD_atomic_relaxed_store_ptr(ABTD_atomic_ptr *ptr, void *val)
static ABTI_xstream * ABTI_local_get_xstream(ABTI_local *p_local)
int ABT_task_is_migratable(ABT_task task, ABT_bool *flag)
Get the migratability of a work unit.
static ABTU_ret_err int ABTI_thread_init_pool(ABTI_global *p_global, ABTI_thread *p_thread, ABTI_pool *p_pool)
int ABT_thread_cancel(ABT_thread thread) ABT_API_PUBLIC
Send a cancellation request to a work unit.
int ABT_task_join(ABT_task task)
Wait for a work unit to terminate.
#define ABTI_TASK_INIT_ID