ARGOBOTS  7496202f85916e93d6d143320764c2aba5026d93
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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 */
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)
struct ABT_thread_attr_opaque * ABT_thread_attr
Definition: abt.h:345
void * p_cb_arg
Definition: abti.h:336
int ABT_bool
Definition: abt.h:373
void * p_stack
Definition: abti.h:330
uint32_t ABTI_thread_type
Definition: abti.h:115
ABT_bool migratable
Definition: abti.h:334
#define ABT_THREAD_ATTR_NULL
Definition: abt.h:417
static ABT_thread_attr ABTI_thread_attr_get_handle(ABTI_thread_attr *p_attr)
static ABTI_thread_attr * ABTI_thread_attr_get_ptr(ABT_thread_attr attr)
void(* f_cb)(ABT_thread, void *)
Definition: abti.h:335
size_t stacksize
Definition: abti.h:331
ABTI_thread_type thread_type
Definition: abti.h:332