ARGOBOTS  29b0d4cc91ca184a8278ddf690fd0bcb2119000e
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions | Variables
thread.c File Reference
#include "abti.h"
Include dependency graph for thread.c:

Go to the source code of this file.

Functions

static ABTU_ret_err int ythread_create (ABTI_local *p_local, ABTI_pool *p_pool, void(*thread_func)(void *), void *arg, ABTI_thread_attr *p_attr, ABTI_thread_type thread_type, ABTI_sched *p_sched, ABT_bool push_pool, ABTI_ythread **pp_newthread)
 
static void thread_join (ABTI_local **pp_local, ABTI_thread *p_thread)
 
static void thread_free (ABTI_local *p_local, ABTI_thread *p_thread, ABT_bool free_unit)
 
static void thread_root_func (void *arg)
 
static void thread_main_sched_func (void *arg)
 
static ABTU_ret_err int thread_migrate_to_xstream (ABTI_local **pp_local, ABTI_thread *p_thread, ABTI_xstream *p_xstream)
 
static ABTU_ret_err int thread_migrate_to_pool (ABTI_local **p_local, ABTI_thread *p_thread, ABTI_pool *p_pool)
 
static ABT_unit_id thread_get_new_id (void)
 
static void thread_key_destructor_stackable_sched (void *p_value)
 
static void thread_key_destructor_migration (void *p_value)
 
int ABT_thread_create (ABT_pool pool, void(*thread_func)(void *), void *arg, ABT_thread_attr attr, ABT_thread *newthread)
 Create a new thread and return its handle through newthread. More...
 
int ABT_thread_create_on_xstream (ABT_xstream xstream, void(*thread_func)(void *), void *arg, ABT_thread_attr attr, ABT_thread *newthread)
 Create a new ULT associated with the target ES (xstream). More...
 
int ABT_thread_create_many (int num, ABT_pool *pool_list, void(**thread_func_list)(void *), void **arg_list, ABT_thread_attr attr, ABT_thread *newthread_list)
 Create a set of ULTs. More...
 
int ABT_thread_revive (ABT_pool pool, void(*thread_func)(void *), void *arg, ABT_thread *thread)
 Revive the ULT. More...
 
int ABT_thread_free (ABT_thread *thread)
 Release the thread object associated with thread handle. More...
 
int ABT_thread_free_many (int num, ABT_thread *thread_list)
 Release a set of ULT objects. More...
 
int ABT_thread_join (ABT_thread thread)
 Wait for thread to terminate. More...
 
int ABT_thread_join_many (int num_threads, ABT_thread *thread_list)
 Wait for a number of ULTs to terminate. More...
 
int ABT_thread_exit (void)
 The calling ULT terminates its execution. More...
 
int ABT_thread_cancel (ABT_thread thread)
 Request the cancellation of the target thread. More...
 
int ABT_thread_self (ABT_thread *thread)
 Return the handle of the calling ULT. More...
 
int ABT_thread_self_id (ABT_unit_id *id)
 Return the calling ULT's ID. More...
 
int ABT_thread_get_last_xstream (ABT_thread thread, ABT_xstream *xstream)
 Get the ES associated with the target thread. More...
 
int ABT_thread_get_state (ABT_thread thread, ABT_thread_state *state)
 Return the state of thread. More...
 
int ABT_thread_get_last_pool (ABT_thread thread, ABT_pool *pool)
 Return the last pool of ULT. More...
 
int ABT_thread_get_last_pool_id (ABT_thread thread, int *id)
 Get the last pool's ID of the ULT. More...
 
int ABT_thread_set_associated_pool (ABT_thread thread, ABT_pool pool)
 Set the associated pool for the target ULT. More...
 
int ABT_thread_yield_to (ABT_thread thread)
 Yield the processor from the current running thread to the specific thread. More...
 
int ABT_thread_yield (void)
 Yield the processor from the current running ULT back to the scheduler. More...
 
int ABT_thread_resume (ABT_thread thread)
 Resume the target ULT. More...
 
int ABT_thread_migrate_to_xstream (ABT_thread thread, ABT_xstream xstream)
 Migrate a thread to a specific ES. More...
 
int ABT_thread_migrate_to_sched (ABT_thread thread, ABT_sched sched)
 Migrate a thread to a specific scheduler. More...
 
int ABT_thread_migrate_to_pool (ABT_thread thread, ABT_pool pool)
 Migrate a thread to a specific pool. More...
 
int ABT_thread_migrate (ABT_thread thread)
 Request migration of the thread to an any available ES. More...
 
int ABT_thread_set_callback (ABT_thread thread, void(*cb_func)(ABT_thread thread, void *cb_arg), void *cb_arg)
 Set the callback function. More...
 
int ABT_thread_set_migratable (ABT_thread thread, ABT_bool flag)
 Set the ULT's migratability. More...
 
int ABT_thread_is_migratable (ABT_thread thread, ABT_bool *flag)
 Get the ULT's migratability. More...
 
int ABT_thread_is_primary (ABT_thread thread, ABT_bool *flag)
 Check if the target ULT is the primary ULT. More...
 
int ABT_thread_is_unnamed (ABT_thread thread, ABT_bool *flag)
 Check if the target ULT is unnamed. More...
 
int ABT_thread_equal (ABT_thread thread1, ABT_thread thread2, ABT_bool *result)
 Compare two ULT handles for equality. More...
 
int ABT_thread_get_stacksize (ABT_thread thread, size_t *stacksize)
 Get the ULT's stack size. More...
 
int ABT_thread_get_id (ABT_thread thread, ABT_unit_id *thread_id)
 Get the ULT's id. More...
 
int ABT_thread_set_arg (ABT_thread thread, void *arg)
 Set the argument for the ULT function. More...
 
int ABT_thread_get_arg (ABT_thread thread, void **arg)
 Retrieve the argument for the ULT function. More...
 
int ABT_thread_set_specific (ABT_thread thread, ABT_key key, void *value)
 Set the ULT-specific value associated with the key. More...
 
int ABT_thread_get_specific (ABT_thread thread, ABT_key key, void **value)
 Get the ULT-specific value associated with the key. More...
 
int ABT_thread_get_attr (ABT_thread thread, ABT_thread_attr *attr)
 Get attributes of the target ULT. More...
 
void ABTI_thread_revive (ABTI_local *p_local, ABTI_pool *p_pool, void(*thread_func)(void *), void *arg, ABTI_thread *p_thread)
 
ABTU_ret_err int ABTI_ythread_create_main (ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **p_ythread)
 
ABTU_ret_err int ABTI_ythread_create_root (ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **pp_root_ythread)
 
ABTU_ret_err int ABTI_ythread_create_main_sched (ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_sched *p_sched)
 
ABTU_ret_err int ABTI_ythread_create_sched (ABTI_local *p_local, ABTI_pool *p_pool, ABTI_sched *p_sched)
 
void ABTI_thread_join (ABTI_local **pp_local, ABTI_thread *p_thread)
 
void ABTI_thread_free (ABTI_local *p_local, ABTI_thread *p_thread)
 
void ABTI_ythread_free_main (ABTI_local *p_local, ABTI_ythread *p_ythread)
 
void ABTI_ythread_free_root (ABTI_local *p_local, ABTI_ythread *p_ythread)
 
ABTU_noreturn void ABTI_ythread_exit (ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
 
ABTU_ret_err int ABTI_thread_get_mig_data (ABTI_local *p_local, ABTI_thread *p_thread, ABTI_thread_mig_data **pp_mig_data)
 
void ABTI_thread_print (ABTI_thread *p_thread, FILE *p_os, int indent)
 
void ABTI_thread_reset_id (void)
 
ABT_unit_id ABTI_thread_get_id (ABTI_thread *p_thread)
 
static void thread_join_busywait (ABTI_thread *p_thread)
 
static void thread_join_yield_ythread (ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_ythread *p_ythread)
 
static void thread_join_yield_task (ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_thread *p_task)
 

Variables

static ABTI_key g_thread_sched_key
 
static ABTI_key g_thread_mig_data_key
 
static ABTD_atomic_uint64 g_thread_id
 

Function Documentation

void ABTI_thread_free ( ABTI_local p_local,
ABTI_thread p_thread 
)
ABT_unit_id ABTI_thread_get_id ( ABTI_thread p_thread)
ABTU_ret_err int ABTI_thread_get_mig_data ( ABTI_local p_local,
ABTI_thread p_thread,
ABTI_thread_mig_data **  pp_mig_data 
)
void ABTI_thread_join ( ABTI_local **  pp_local,
ABTI_thread p_thread 
)

Definition at line 1470 of file thread.c.

Referenced by xstream_join().

void ABTI_thread_print ( ABTI_thread p_thread,
FILE *  p_os,
int  indent 
)

Definition at line 1532 of file thread.c.

Referenced by ABT_info_print_thread().

void ABTI_thread_reset_id ( void  )

Definition at line 1595 of file thread.c.

Referenced by init_library().

void ABTI_thread_revive ( ABTI_local p_local,
ABTI_pool p_pool,
void(*)(void *)  thread_func,
void *  arg,
ABTI_thread p_thread 
)

Definition at line 1325 of file thread.c.

Referenced by ABT_thread_revive(), and ABT_xstream_revive().

ABTU_ret_err int ABTI_ythread_create_main ( ABTI_local p_local,
ABTI_xstream p_xstream,
ABTI_ythread **  p_ythread 
)

Definition at line 1378 of file thread.c.

Referenced by init_library().

ABTU_ret_err int ABTI_ythread_create_main_sched ( ABTI_local p_local,
ABTI_xstream p_xstream,
ABTI_sched p_sched 
)

Definition at line 1432 of file thread.c.

Referenced by xstream_create().

ABTU_ret_err int ABTI_ythread_create_root ( ABTI_local p_local,
ABTI_xstream p_xstream,
ABTI_ythread **  pp_root_ythread 
)

Definition at line 1406 of file thread.c.

Referenced by xstream_create().

ABTU_ret_err int ABTI_ythread_create_sched ( ABTI_local p_local,
ABTI_pool p_pool,
ABTI_sched p_sched 
)

Definition at line 1452 of file thread.c.

Referenced by ABT_pool_add_sched().

ABTU_noreturn void ABTI_ythread_exit ( ABTI_xstream p_local_xstream,
ABTI_ythread p_ythread 
)

Definition at line 1497 of file thread.c.

Referenced by ABT_thread_exit(), and ABT_xstream_exit().

void ABTI_ythread_free_main ( ABTI_local p_local,
ABTI_ythread p_ythread 
)

Definition at line 1484 of file thread.c.

Referenced by finailze_library().

void ABTI_ythread_free_root ( ABTI_local p_local,
ABTI_ythread p_ythread 
)

Definition at line 1492 of file thread.c.

Referenced by ABTI_xstream_free().

static void thread_free ( ABTI_local p_local,
ABTI_thread p_thread,
ABT_bool  free_unit 
)
inlinestatic

Definition at line 1814 of file thread.c.

Referenced by ABTI_thread_free(), ABTI_ythread_free_main(), and ABTI_ythread_free_root().

static ABT_unit_id thread_get_new_id ( void  )
inlinestatic

Definition at line 2177 of file thread.c.

Referenced by ABTI_thread_get_id().

static void thread_join ( ABTI_local **  pp_local,
ABTI_thread p_thread 
)
inlinestatic
static void thread_join_busywait ( ABTI_thread p_thread)
static

Definition at line 1858 of file thread.c.

Referenced by thread_join().

static void thread_join_yield_task ( ABTI_xstream **  pp_local_xstream,
ABTI_ythread p_self,
ABTI_thread p_task 
)
static

Definition at line 1880 of file thread.c.

Referenced by thread_join().

static void thread_join_yield_ythread ( ABTI_xstream **  pp_local_xstream,
ABTI_ythread p_self,
ABTI_ythread p_ythread 
)
static

Definition at line 1867 of file thread.c.

Referenced by thread_join().

static void thread_key_destructor_migration ( void *  p_value)
static

Definition at line 1852 of file thread.c.

static void thread_key_destructor_stackable_sched ( void *  p_value)
static

Definition at line 1840 of file thread.c.

static void thread_main_sched_func ( void *  arg)
static

Definition at line 2095 of file thread.c.

Referenced by ABTI_ythread_create_main_sched().

static ABTU_ret_err int thread_migrate_to_pool ( ABTI_local **  p_local,
ABTI_thread p_thread,
ABTI_pool p_pool 
)
static
static ABTU_ret_err int thread_migrate_to_xstream ( ABTI_local **  pp_local,
ABTI_thread p_thread,
ABTI_xstream p_xstream 
)
static

Definition at line 2133 of file thread.c.

Referenced by ABT_thread_migrate(), and ABT_thread_migrate_to_xstream().

static void thread_root_func ( void *  arg)
static

Definition at line 2058 of file thread.c.

Referenced by ABTI_ythread_create_root().

static ABTU_ret_err int ythread_create ( ABTI_local p_local,
ABTI_pool p_pool,
void(*)(void *)  thread_func,
void *  arg,
ABTI_thread_attr p_attr,
ABTI_thread_type  thread_type,
ABTI_sched p_sched,
ABT_bool  push_pool,
ABTI_ythread **  pp_newthread 
)
inlinestatic

Variable Documentation

ABTD_atomic_uint64 g_thread_id
static
Initial value:
=
#define ABTD_ATOMIC_UINT64_STATIC_INITIALIZER(val)
Definition: abtd_atomic.h:59

Definition at line 1593 of file thread.c.

ABTI_key g_thread_mig_data_key
static
Initial value:
=
#define ABTI_KEY_STATIC_INITIALIZER(f_destructor, id)
Definition: abti_key.h:42
static void thread_key_destructor_migration(void *p_value)
Definition: thread.c:1852
#define ABTI_KEY_ID_MIGRATION
Definition: abti_key.h:48

Definition at line 33 of file thread.c.

ABTI_key g_thread_sched_key
static
Initial value:
=
static void thread_key_destructor_stackable_sched(void *p_value)
Definition: thread.c:1840
#define ABTI_KEY_STATIC_INITIALIZER(f_destructor, id)
Definition: abti_key.h:42
#define ABTI_KEY_ID_STACKABLE_SCHED
Definition: abti_key.h:47

Definition at line 29 of file thread.c.