Go to the documentation of this file.
66 size_t arg_num_compartments = num_compartments;
72 p_future->num_compartments = arg_num_compartments;
73 if (arg_num_compartments > 0) {
74 abt_errno =
ABTU_malloc(arg_num_compartments *
sizeof(
void *),
75 (
void **)&p_future->array);
81 p_future->array = NULL;
83 p_future->p_callback = cb_func;
171 #ifndef ABT_CONFIG_ENABLE_VER_20_API
268 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
270 if (counter >= num_compartments) {
275 p_future->
array[counter] = value;
278 if (counter == num_compartments && p_future->
p_callback != NULL) {
284 if (counter == num_compartments) {
int ABT_bool
Boolean type.
static void ABTD_atomic_release_store_size(ABTD_atomic_size *ptr, size_t val)
static void ABTI_waitlist_broadcast(ABTI_local *p_local, ABTI_waitlist *p_waitlist)
int ABT_future_free(ABT_future *future)
Free a future.
int ABT_future_wait(ABT_future future)
Wait on a future.
#define ABTI_CHECK_ERROR(abt_errno)
#define ABTI_THREAD_TYPE_YIELDABLE
static ABT_future ABTI_future_get_handle(ABTI_future *p_future)
#define ABT_ERR_FUTURE
Error code: error related to a future.
#define ABTI_IS_ERROR_CHECK_ENABLED
int ABT_future_create(uint32_t num_compartments, void(*cb_func)(void **arg), ABT_future *newfuture)
Create a new future.
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
#define ABTI_HANDLE_ERROR(n)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
struct ABT_future_opaque * ABT_future
Future handle type.
static size_t ABTD_atomic_relaxed_load_size(const ABTD_atomic_size *ptr)
static size_t ABTD_atomic_acquire_load_size(const ABTD_atomic_size *ptr)
static void ABTD_atomic_relaxed_store_size(ABTD_atomic_size *ptr, size_t val)
static ABTI_local * ABTI_local_get_local(void)
#define ABT_SUCCESS
Error code: the routine returns successfully.
#define ABT_TRUE
True constant for ABT_bool.
#define ABTI_CHECK_NULL_FUTURE_PTR(p)
static void ABTD_spinlock_clear(ABTD_spinlock *p_lock)
#define ABT_FALSE
False constant for ABT_bool.
int ABT_future_set(ABT_future future, void *value)
Signal a future.
static void ABTU_free(void *ptr)
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
int ABT_future_reset(ABT_future future)
Reset readiness of a future.
struct ABTI_local ABTI_local
#define ABTI_CHECK_TRUE(cond, abt_errno)
static void ABTI_waitlist_init(ABTI_waitlist *p_waitlist)
static ABTI_xstream * ABTI_local_get_xstream(ABTI_local *p_local)
static void ABTI_waitlist_wait_and_unlock(ABTI_local **pp_local, ABTI_waitlist *p_waitlist, ABTD_spinlock *p_lock, ABT_sync_event_type sync_event_type, void *p_sync)
void(* p_callback)(void **arg)
static ABTI_future * ABTI_future_get_ptr(ABT_future future)
int ABT_future_test(ABT_future future, ABT_bool *is_ready)
Check if a future is ready.