Go to the documentation of this file.
128 p_data->num_threads = 0;
129 p_data->p_head = NULL;
130 p_data->p_tail = NULL;
133 p_pool->
data = p_data;
164 p_thread->
p_prev = p_thread;
165 p_thread->
p_next = p_thread;
166 p_data->
p_head = p_thread;
167 p_data->
p_tail = p_thread;
177 p_data->
p_tail = p_thread;
192 p_thread->
p_prev = p_thread;
193 p_thread->
p_next = p_thread;
194 p_data->
p_head = p_thread;
195 p_data->
p_tail = p_thread;
205 p_data->
p_tail = p_thread;
218 double time_start = 0.0;
224 p_thread = p_data->
p_head;
247 if (time_start == 0.0) {
251 if (elapsed > time_secs)
255 const int sleep_nsecs = 100;
256 struct timespec ts = { 0, sleep_nsecs };
257 nanosleep(&ts, NULL);
271 p_thread = p_data->
p_head;
294 const int sleep_nsecs = 100;
295 struct timespec ts = { 0, sleep_nsecs };
296 nanosleep(&ts, NULL);
312 p_thread = p_data->
p_head;
346 p_thread = p_data->
p_head;
387 if (p_thread == p_data->
p_head) {
389 }
else if (p_thread == p_data->
p_tail) {
422 if (p_thread == p_data->
p_head) {
424 }
else if (p_thread == p_data->
p_tail) {
451 while (num_threads--) {
455 p_thread = p_thread->
p_next;
ABT_pool_get_size_fn p_get_size
int ABT_bool
Boolean type.
static void pool_push_private(ABT_pool pool, ABT_unit unit)
ABT_pool_remove_fn p_remove
struct ABT_thread_opaque * ABT_thread
Work unit handle type.
ABT_pool_print_all_fn p_print_all
ABTU_ret_err int ABTI_pool_get_fifo_def(ABT_pool_access access, ABTI_pool_def *p_def)
static ABT_unit ABTI_unit_get_builtin_unit(ABTI_thread *p_thread)
#define ABT_ERR_POOL
Error code: error related to a pool.
#define ABTI_CHECK_ERROR(abt_errno)
static void unit_free(ABT_unit *unit)
static ABTI_thread * ABTI_unit_get_thread_from_builtin_unit(ABT_unit unit)
static int pool_free(ABT_pool pool)
struct ABT_pool_opaque * ABT_pool
Pool handle type.
static ABT_unit unit_create_from_thread(ABT_thread thread)
static ABT_unit pool_pop_shared(ABT_pool pool)
static int pool_remove_private(ABT_pool pool, ABT_unit unit)
static size_t pool_get_size(ABT_pool pool)
static ABT_unit pool_pop_timedwait(ABT_pool pool, double abstime_secs)
ABT_unit_is_in_pool_fn u_is_in_pool
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
#define ABTI_HANDLE_ERROR(n)
struct ABT_pool_config_opaque * ABT_pool_config
Pool configuration handle type.
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
static ABTU_ret_err int spinlock_acquire_if_not_empty(data_t *p_data)
static void ABTD_atomic_relaxed_store_int(ABTD_atomic_int *ptr, int val)
#define ABT_ERR_INV_POOL_ACCESS
Error code: invalid pool access type.
static int pool_remove_shared(ABT_pool pool, ABT_unit unit)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
ABT_unit_create_from_thread_fn u_create_from_thread
#define ABTI_ASSERT(cond)
ABT_pool_pop_timedwait_fn p_pop_timedwait
ABTD_atomic_int is_in_pool
static ABT_unit pool_pop_wait(ABT_pool pool, double time_secs)
static ABT_bool ABTD_spinlock_try_acquire(ABTD_spinlock *p_lock)
#define ABT_SUCCESS
Error code: the routine returns successfully.
ABT_pool_pop_wait_fn p_pop_wait
static int ABTD_atomic_acquire_load_int(const ABTD_atomic_int *ptr)
static int pool_print_all(ABT_pool pool, void *arg, void(*print_fn)(void *, ABT_unit))
#define ABT_TRUE
True constant for ABT_bool.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
static void ABTD_spinlock_clear(ABTD_spinlock *p_lock)
static data_t * pool_get_data_ptr(void *p_data)
#define ABT_FALSE
False constant for ABT_bool.
static void ABTU_free(void *ptr)
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
static ABT_bool unit_is_in_pool(ABT_unit unit)
#define ABTI_CHECK_TRUE(cond, abt_errno)
static ABT_bool ABTD_spinlock_is_locked(const ABTD_spinlock *p_lock)
static int pool_init(ABT_pool pool, ABT_pool_config config)
static ABT_unit pool_pop_private(ABT_pool pool)
static void pool_push_shared(ABT_pool pool, ABT_unit unit)
static void ABTD_atomic_release_store_int(ABTD_atomic_int *ptr, int val)
static double ABTI_get_wtime(void)
ABT_pool_access
Pool access type.