ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
6 #ifndef ABTI_YTHREAD_H_INCLUDED
7 #define ABTI_YTHREAD_H_INCLUDED
13 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
28 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
30 if (p_ythread == NULL) {
128 void (*f_cb)(
void *),
void *cb_arg)
154 p_local_xstream->p_thread = &p_new->
thread;
165 void (*f_cb)(
void *),
void *cb_arg)
170 p_local_xstream->p_thread = &p_new->
thread;
178 void (*f_cb)(
void *),
void *cb_arg)
184 p_local_xstream->p_thread = &p_new->
thread;
199 p_local_xstream->p_thread = &p_new->
thread;
208 void (*f_cb)(
void *),
void *cb_arg)
212 p_local_xstream->p_thread = &p_new->
thread;
222 void (*f_peek)(
void *),
261 sync_event_type, p_sync);
280 sync_event_type, p_sync);
285 pp_local_xstream, p_self, p_target,
289 pp_local_xstream, p_self, p_target,
294 pp_local_xstream, p_self, p_target,
308 sync_event_type, p_sync);
313 pp_local_xstream, p_self, p_target,
339 p_target, &p_self->
thread);
341 sync_event_type, p_sync);
347 pp_local_xstream, p_self, p_target,
396 p_target, &p_self->
thread);
404 pp_local_xstream, p_self, p_target,
442 #ifndef ABT_CONFIG_ACTIVE_WAIT_POLICY
466 #ifndef ABT_CONFIG_ACTIVE_WAIT_POLICY
484 p_joiner, &p_self->
thread);
535 p_local_xstream->p_thread = &p_primary->
thread;
678 ABTI_thread *p_sched_thread = p_local_xstream->p_thread;
679 p_local_xstream->p_thread = p_thread;
680 p_thread->
p_parent = p_sched_thread;
689 p_local_xstream->p_thread = p_sched_thread;
#define ABTI_event_ythread_suspend(p_local_xstream, p_ythread, p_parent, sync_event_type, p_sync)
void ABTI_ythread_callback_yield_create_to(void *arg)
void ABTI_ythread_callback_resume_suspend_to(void *arg)
int ABT_bool
Boolean type.
static void ABTI_ythread_yield_orphan(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABT_sync_event_type sync_event_type, void *p_sync)
void ABTI_ythread_callback_thread_yield_to(void *arg)
static ABTI_ythread * ABTI_ythread_atomic_get_joiner(ABTI_ythread *p_ythread)
static ABTI_ythread * ABTI_ythread_get_ptr(ABT_thread thread)
static ABTU_noreturn void ABTD_ythread_context_start_and_jump_with_call(ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
#define ABTI_event_thread_run(p_local_xstream, p_thread, p_prev, p_parent)
static void ABTD_ythread_context_start_and_switch(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new)
struct ABT_thread_opaque * ABT_thread
Work unit handle type.
void ABTI_ythread_callback_resume_exit_to(void *arg)
static ABTU_noreturn void ABTD_ythread_context_jump(ABTD_ythread_context *p_new)
static void ABTI_ythread_thread_yield_to(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABT_sync_event_type sync_event_type, void *p_sync)
static ABTU_noreturn void ABTD_ythread_context_start_and_jump(ABTD_ythread_context *p_new)
static void ABTI_ythread_suspend_replace_sched(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_sched *p_main_sched, ABT_sync_event_type sync_event_type, void *p_sync)
@ ABTI_YTHREAD_YIELD_KIND_YIELD_LOOP
ABTD_atomic_uint32 request
static ABTI_ythread * ABTI_thread_get_ythread(ABTI_thread *p_thread)
static ABT_bool ABTD_ythread_context_peek(ABTD_ythread_context *p_target_ctx, void(*f_peek)(void *), void *arg)
ABTD_ythread_context_atomic_ptr p_link
void ABTI_ythread_callback_suspend(void *arg)
static ABT_thread ABTI_ythread_get_handle(ABTI_ythread *p_ythread)
static void ABTI_ythread_switch_to_sibling_internal(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new, void(*f_cb)(void *), void *cb_arg)
#define ABTI_THREAD_TYPE_EXT
#define ABTU_likely(cond)
static ABTU_noreturn void ABTI_ythread_context_jump(ABTI_xstream *p_local_xstream, ABTI_ythread *p_new)
static void ABTI_ythread_switch_to_parent_internal(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_old, void(*f_cb)(void *), void *cb_arg)
static ABT_bool ABTD_ythread_context_is_started(const ABTD_ythread_context *p_ctx)
#define ABTU_unreachable()
ABTI_sched * p_main_sched
static ABTI_ythread * ABTI_ythread_context_get_ythread(ABTD_ythread_context *p_ctx)
void ABTI_ythread_callback_yield_user_yield_to(void *arg)
static void ABTD_ythread_context_start_and_switch_with_call(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
static void ABTD_ythread_context_switch_with_call(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
@ ABT_THREAD_STATE_BLOCKED
static ABTU_noreturn void ABTI_ythread_context_jump_with_call(ABTI_xstream *p_local_xstream, ABTI_ythread *p_new, void(*f_cb)(void *), void *cb_arg)
static void ABTI_ythread_suspend_unlock(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTD_spinlock *p_lock, ABT_sync_event_type sync_event_type, void *p_sync)
static ABT_bool ABTI_ythread_context_peek(ABTI_ythread *p_ythread, void(*f_peek)(void *), void *arg)
void ABTI_ythread_callback_yield_revive_to(void *arg)
static ABTI_ythread * ABTI_thread_get_ythread_or_null(ABTI_thread *p_thread)
static void ABTI_ythread_context_switch(ABTI_xstream *p_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new)
static void ABTI_ythread_resume_and_push(ABTI_local *p_local, ABTI_ythread *p_ythread)
#define ABT_POOL_CONTEXT_OP_THREAD_MIGRATE
A flag that hints a push operation for thread migration.
#define ABTI_THREAD_HANDLE_REQUEST_CANCELLED
#define ABT_POOL_CONTEXT_OP_THREAD_RESUME
A flag that hints a push operation in a thread resume routine.
static void ABTI_ythread_suspend_join(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABT_sync_event_type sync_event_type, void *p_sync)
void ABTI_ythread_callback_suspend_unlock(void *arg)
@ ABTI_YTHREAD_RESUME_YIELD_TO_KIND_USER
#define ABTI_ASSERT(cond)
static void ABTI_ythread_context_switch_with_call(ABTI_xstream *p_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new, void(*f_cb)(void *), void *cb_arg)
ABTI_ythread * p_primary_ythread
#define ABT_SUCCESS
Error code: the routine returns successfully.
void ABTI_ythread_callback_suspend_replace_sched(void *arg)
static void ABTI_ythread_schedule(ABTI_global *p_global, ABTI_xstream **pp_local_xstream, ABTI_thread *p_thread)
static void ABTI_ythread_resume_yield_to(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABTI_ythread_resume_yield_to_kind kind, ABT_sync_event_type sync_event_type, void *p_sync)
static int ABTD_atomic_acquire_load_int(const ABTD_atomic_int *ptr)
static void ABTI_ythread_yield(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread_yield_kind kind, ABT_sync_event_type sync_event_type, void *p_sync)
#define ABTI_THREAD_HANDLE_REQUEST_MIGRATED
static ABTI_xstream * ABTI_local_get_xstream_or_null(ABTI_local *p_local)
void ABTI_ythread_callback_resume_yield_to(void *arg)
#define ABTI_event_ythread_resume(p_local, p_ythread, p_caller)
static ABTI_local * ABTI_xstream_get_local(ABTI_xstream *p_xstream)
#define ABT_TRUE
True constant for ABT_bool.
static void ABTI_pool_add_thread(ABTI_thread *p_thread, ABT_pool_context context)
void ABTI_ythread_callback_yield_user_yield(void *arg)
static ABTU_noreturn void ABTD_ythread_context_jump_with_call(ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
static void ABTI_ythread_resume_joiner(ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
void ABTD_futex_resume(ABTD_futex_single *p_futex)
static ABTU_noreturn void ABTI_ythread_exit(ABTI_xstream *p_local_xstream, ABTI_ythread *p_self)
static void ABTI_ythread_suspend_to(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABT_sync_event_type sync_event_type, void *p_sync)
@ ABTI_YTHREAD_YIELD_TO_KIND_USER
static ABTU_noreturn void ABTI_ythread_jump_to_parent_internal(ABTI_xstream *p_local_xstream, ABTI_ythread *p_old, void(*f_cb)(void *), void *cb_arg)
void ABTI_ythread_callback_suspend_join(void *arg)
#define ABTI_THREAD_TYPE_MAIN_SCHED
#define ABTI_UB_ASSERT(cond)
static void ABTD_ythread_context_switch(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new)
@ ABTI_YTHREAD_YIELD_TO_KIND_REVIVE_TO
static void ABTI_ythread_switch_to_child_internal(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new)
static uint32_t ABTD_atomic_fetch_or_uint32(ABTD_atomic_uint32 *ptr, uint32_t v)
@ ABTI_YTHREAD_YIELD_KIND_USER
static ABTU_noreturn void ABTI_ythread_exit_to_primary(ABTI_global *p_global, ABTI_xstream *p_local_xstream, ABTI_ythread *p_self)
ABTI_ythread_yield_to_kind
ABTI_xstream * p_last_xstream
static ABTU_noreturn void ABTI_ythread_jump_to_sibling_internal(ABTI_xstream *p_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new, void(*f_cb)(void *), void *cb_arg)
struct ABTI_local ABTI_local
static void ABTI_ythread_yield_to(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABTI_ythread_yield_to_kind kind, ABT_sync_event_type sync_event_type, void *p_sync)
static int ABTI_thread_handle_request(ABTI_thread *p_thread, ABT_bool allow_termination)
static void ABTI_ythread_suspend(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABT_sync_event_type sync_event_type, void *p_sync)
@ ABT_THREAD_STATE_RUNNING
void ABTI_ythread_callback_yield_loop(void *arg)
@ ABTI_YTHREAD_YIELD_TO_KIND_CREATE_TO
static ABTI_xstream * ABTI_local_get_xstream(ABTI_local *p_local)
#define ABTI_THREAD_HANDLE_REQUEST_NONE
static void ABTI_ythread_resume_suspend_to(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target, ABT_sync_event_type sync_event_type, void *p_sync)
static ABT_bool ABTD_ythread_context_has_stack(const ABTD_ythread_context *p_ctx)
static void ABTD_atomic_release_store_int(ABTD_atomic_int *ptr, int val)
static ABTU_noreturn void ABTI_ythread_exit_to(ABTI_xstream *p_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target)
static void ABTI_ythread_run_child(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_child)
#define ABTI_event_ythread_yield(p_local_xstream, p_ythread, p_parent, sync_event_type, p_sync)
ABTI_ythread_resume_yield_to_kind
void ABTI_ythread_callback_exit(void *arg)
#define ABTI_event_thread_finish(p_local_xstream, p_thread, p_parent)
static void ABTI_thread_terminate(ABTI_global *p_global, ABTI_xstream *p_local_xstream, ABTI_thread *p_thread)
static void ABTI_pool_dec_num_blocked(ABTI_pool *p_pool)
static ABTU_ret_err int ABTI_mem_alloc_ythread_mempool_stack(ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
static ABTU_noreturn void ABTI_ythread_resume_exit_to(ABTI_xstream *p_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_target)
static ABTD_ythread_context * ABTD_atomic_acquire_load_ythread_context_ptr(const ABTD_ythread_context_atomic_ptr *ptr)
void ABTI_ythread_callback_orphan(void *arg)
#define ABTI_THREAD_REQ_JOIN