9 ABTI_thread_attr *p_attr,
void *stackaddr,
52 ABTI_UB_ASSERT(ABTI_initialized());
53 ABTI_UB_ASSERT(newattr);
55 #ifndef ABT_CONFIG_ENABLE_VER_20_API
59 ABTI_global *p_global;
60 ABTI_SETUP_GLOBAL(&p_global);
62 ABTI_thread_attr *p_newattr;
63 int abt_errno =
ABTU_malloc(
sizeof(ABTI_thread_attr), (
void **)&p_newattr);
64 ABTI_CHECK_ERROR(abt_errno);
67 ABTI_thread_attr_init(p_newattr, NULL, p_global->thread_stacksize,
69 *newattr = ABTI_thread_attr_get_handle(p_newattr);
97 ABTI_UB_ASSERT(ABTI_initialized());
101 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(h_attr);
102 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
161 ABTI_UB_ASSERT(ABTI_initialized());
163 ABTI_global *p_global;
164 ABTI_SETUP_GLOBAL(&p_global);
166 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
167 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
169 ABTI_CHECK_TRUE(stackaddr == NULL || ((uintptr_t)stackaddr & 0x7) == 0,
203 ABTI_UB_ASSERT(ABTI_initialized());
204 ABTI_UB_ASSERT(stackaddr);
205 ABTI_UB_ASSERT(stacksize);
207 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
208 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
210 *stackaddr = p_attr->p_stack;
211 *stacksize = p_attr->stacksize;
241 ABTI_UB_ASSERT(ABTI_initialized());
243 ABTI_global *p_global;
244 ABTI_SETUP_GLOBAL(&p_global);
246 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
247 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
277 ABTI_UB_ASSERT(ABTI_initialized());
278 ABTI_UB_ASSERT(stacksize);
280 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
281 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
283 *stacksize = p_attr->stacksize;
326 ABTI_UB_ASSERT(ABTI_initialized());
328 #ifndef ABT_CONFIG_DISABLE_MIGRATION
329 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
330 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
333 p_attr->f_cb = cb_func;
334 p_attr->p_cb_arg = cb_arg;
370 ABTI_UB_ASSERT(ABTI_initialized());
371 ABTI_UB_ASSERT_BOOL(is_migratable);
373 #ifndef ABT_CONFIG_DISABLE_MIGRATION
374 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
375 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
378 p_attr->migratable = is_migratable;
389 void ABTI_thread_attr_print(ABTI_thread_attr *p_attr, FILE *p_os,
int indent)
391 if (p_attr == NULL) {
392 fprintf(p_os,
"%*sULT attr: [NULL ATTR]\n", indent,
"");
394 #ifndef ABT_CONFIG_DISABLE_MIGRATION
402 indent,
"", p_attr->p_stack, p_attr->stacksize,
403 (p_attr->migratable ==
ABT_TRUE ?
"TRUE" :
"FALSE"),
411 indent,
"", p_attr->p_stack, p_attr->stacksize);
417 ABTU_ret_err int ABTI_thread_attr_dup(
const ABTI_thread_attr *p_attr,
418 ABTI_thread_attr **pp_dup_attr)
420 ABTI_thread_attr *p_dup_attr;
421 int abt_errno =
ABTU_malloc(
sizeof(ABTI_thread_attr), (
void **)&p_dup_attr);
422 ABTI_CHECK_ERROR(abt_errno);
424 memcpy(p_dup_attr, p_attr,
sizeof(ABTI_thread_attr));
425 *pp_dup_attr = p_dup_attr;
434 ABTI_thread_attr *p_attr,
void *stackaddr,
437 if (stackaddr != NULL) {
439 ABTI_ASSERT(((uintptr_t)stackaddr & 0x7) == 0);
443 p_attr->p_stack = stackaddr;
444 p_attr->stacksize = stacksize;