Go to the documentation of this file.
6 #ifndef ABTI_UNIT_H_INCLUDED
7 #define ABTI_UNIT_H_INCLUDED
10 #define ABTI_UNIT_BUILTIN_POOL_BIT ((uintptr_t)0x1)
64 *pp_thread = p_thread;
77 p_thread->
unit = new_unit;
79 *pp_thread = p_thread;
93 *pp_thread = p_thread;
95 }
else if (p_thread->
p_pool == p_pool) {
97 *pp_thread = p_thread;
107 p_pool->
u_free(&new_unit);
112 p_thread->
unit = new_unit;
113 p_thread->
p_pool = p_pool;
114 *pp_thread = p_thread;
128 p_thread->
p_pool = p_pool;
137 p_pool->
u_free(&new_unit);
140 p_thread->
unit = new_unit;
141 p_thread->
p_pool = p_pool;
154 p_thread->
p_pool = p_pool;
164 p_pool->
u_free(&new_unit);
167 p_thread->
unit = new_unit;
168 p_thread->
p_pool = p_pool;
176 p_thread->
p_pool = p_pool;
178 }
else if (p_thread->
p_pool == p_pool) {
189 p_pool->
u_free(&new_unit);
194 p_thread->
unit = new_unit;
195 p_thread->
p_pool = p_pool;
208 #if ABTI_IS_ERROR_CHECK_ENABLED
static ABT_bool ABTI_unit_is_builtin(ABT_unit unit)
int ABT_bool
Boolean type.
static ABTU_ret_err int ABTI_unit_set_associated_pool(ABTI_global *p_global, ABT_unit unit, ABTI_pool *p_pool, ABTI_thread **pp_thread)
static ABT_unit ABTI_unit_get_builtin_unit(ABTI_thread *p_thread)
static ABTI_thread * ABTI_unit_get_thread_from_builtin_unit(ABT_unit unit)
static ABT_thread ABTI_thread_get_handle(ABTI_thread *p_thread)
static ABTU_ret_err int ABTI_thread_set_associated_pool(ABTI_global *p_global, ABTI_thread *p_thread, ABTI_pool *p_pool)
ABT_unit_create_from_thread_fn u_create_from_thread
void ABTI_unit_unmap_thread(ABTI_global *p_global, ABT_unit unit)
#define ABTI_UNIT_BUILTIN_POOL_BIT
#define ABTU_likely(cond)
static void ABTI_unit_init_builtin(ABTI_thread *p_thread)
static void ABTD_atomic_relaxed_store_int(ABTD_atomic_int *ptr, int val)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
#define ABTI_ASSERT(cond)
ABTD_atomic_int is_in_pool
ABTI_thread * ABTI_unit_get_thread_from_user_defined_unit(ABTI_global *p_global, ABT_unit unit)
#define ABT_SUCCESS
Error code: the routine returns successfully.
#define ABTU_unlikely(cond)
#define ABT_TRUE
True constant for ABT_bool.
#define ABT_FALSE
False constant for ABT_bool.
static ABTI_thread * ABTI_unit_get_thread(ABTI_global *p_global, ABT_unit unit)
#define ABT_ERR_OTHER
Error code: other error.
static void ABTI_thread_unset_associated_pool(ABTI_global *p_global, ABTI_thread *p_thread)
ABTU_ret_err int ABTI_unit_map_thread(ABTI_global *p_global, ABT_unit unit, ABTI_thread *p_thread)
static ABTU_ret_err int ABTI_thread_init_pool(ABTI_global *p_global, ABTI_thread *p_thread, ABTI_pool *p_pool)