ARGOBOTS  66b1c39742507d8df30e8d28c54839b961a14814
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
unit.c
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #include "abti.h"
7 
28 {
29  ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
31 
32  ABTI_unit_set_associated_pool(unit, p_pool);
33  return ABT_SUCCESS;
34 }
35 
36 /*****************************************************************************/
37 /* Private APIs */
38 /*****************************************************************************/
39 
41 {
42  ABT_unit_type type = p_pool->u_get_type(unit);
43 
44  if (type == ABT_UNIT_TYPE_THREAD) {
45  ABT_thread thread = p_pool->u_get_thread(unit);
46  ABTI_ythread *p_thread = ABTI_ythread_get_ptr(thread);
47  p_thread->thread.p_pool = p_pool;
48 
49  } else {
51  ABT_task task = p_pool->u_get_task(unit);
52  ABTI_thread *p_task = ABTI_thread_get_ptr(task);
53  p_task->p_pool = p_pool;
54  }
55 }
static ABTI_ythread * ABTI_ythread_get_ptr(ABT_thread thread)
Definition: abti_ythread.h:11
ABTI_pool * p_pool
Definition: abti.h:324
struct ABT_unit_opaque * ABT_unit
Definition: abt.h:337
ABT_unit_get_type_fn u_get_type
Definition: abti.h:292
static ABTI_thread * ABTI_thread_get_ptr(ABT_thread thread)
Definition: abti_thread.h:9
struct ABT_thread_opaque * ABT_task
Definition: abt.h:353
ABT_unit_get_task_fn u_get_task
Definition: abti.h:294
struct ABT_pool_opaque * ABT_pool
Definition: abt.h:329
ABT_unit_get_thread_fn u_get_thread
Definition: abti.h:293
struct ABT_thread_opaque * ABT_thread
Definition: abt.h:343
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
Definition: abti_pool.h:11
ABTI_thread thread
Definition: abti.h:348
#define ABT_SUCCESS
Definition: abt.h:64
ABT_unit_type
Definition: abt.h:169
void ABTI_unit_set_associated_pool(ABT_unit unit, ABTI_pool *p_pool)
Definition: unit.c:40
#define ABTI_CHECK_NULL_POOL_PTR(p)
Definition: abti_error.h:175
#define ABTI_ASSERT(cond)
Definition: abti_error.h:12
int ABT_unit_set_associated_pool(ABT_unit unit, ABT_pool pool) ABT_API_PUBLIC
Set the associated pool for the target work unit.
Definition: unit.c:27