ARGOBOTS  1.1
abti_thread_attr.h
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 #ifndef ABTI_THREAD_ATTR_H_INCLUDED
7 #define ABTI_THREAD_ATTR_H_INCLUDED
8 
9 /* Inlined functions for ULT Attributes */
10 
12 {
13 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
14  ABTI_thread_attr *p_attr;
15  if (attr == ABT_THREAD_ATTR_NULL) {
16  p_attr = NULL;
17  } else {
18  p_attr = (ABTI_thread_attr *)attr;
19  }
20  return p_attr;
21 #else
22  return (ABTI_thread_attr *)attr;
23 #endif
24 }
25 
26 static inline ABT_thread_attr
28 {
29 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
30  ABT_thread_attr h_attr;
31  if (p_attr == NULL) {
32  h_attr = ABT_THREAD_ATTR_NULL;
33  } else {
34  h_attr = (ABT_thread_attr)p_attr;
35  }
36  return h_attr;
37 #else
38  return (ABT_thread_attr)p_attr;
39 #endif
40 }
41 
42 static inline void ABTI_thread_attr_init(ABTI_thread_attr *p_attr,
43  void *p_stack, size_t stacksize,
44  ABTI_thread_type thread_type,
45  ABT_bool migratable)
46 {
47  p_attr->p_stack = p_stack;
48  p_attr->stacksize = stacksize;
49  p_attr->thread_type = thread_type;
50 #ifndef ABT_CONFIG_DISABLE_MIGRATION
51  p_attr->migratable = migratable;
52  p_attr->f_cb = NULL;
53  p_attr->p_cb_arg = NULL;
54 #endif
55 }
56 
57 #endif /* ABTI_THREAD_ATTR_H_INCLUDED */
ABT_bool
int ABT_bool
Boolean type.
Definition: abt.h:1001
ABT_thread_attr
struct ABT_thread_attr_opaque * ABT_thread_attr
ULT attribute handle type.
Definition: abt.h:897
ABTI_thread_attr::migratable
ABT_bool migratable
Definition: abti.h:393
ABTI_thread_attr_get_handle
static ABT_thread_attr ABTI_thread_attr_get_handle(ABTI_thread_attr *p_attr)
Definition: abti_thread_attr.h:27
ABTI_thread_attr_get_ptr
static ABTI_thread_attr * ABTI_thread_attr_get_ptr(ABT_thread_attr attr)
Definition: abti_thread_attr.h:11
ABTI_thread_attr
Definition: abti.h:388
ABTI_thread_attr_init
static void ABTI_thread_attr_init(ABTI_thread_attr *p_attr, void *p_stack, size_t stacksize, ABTI_thread_type thread_type, ABT_bool migratable)
Definition: abti_thread_attr.h:42
ABTI_thread_attr::p_cb_arg
void * p_cb_arg
Definition: abti.h:395
ABT_THREAD_ATTR_NULL
#define ABT_THREAD_ATTR_NULL
Definition: abt.h:1063
ABTI_thread_attr::stacksize
size_t stacksize
Definition: abti.h:390
ABTI_thread_type
uint32_t ABTI_thread_type
Definition: abti.h:126
ABTI_thread_attr::p_stack
void * p_stack
Definition: abti.h:389
ABTI_thread_attr::thread_type
ABTI_thread_type thread_type
Definition: abti.h:391
ABTI_thread_attr::f_cb
void(* f_cb)(ABT_thread, void *)
Definition: abti.h:394