29 ABTI_mutex_attr *p_newattr;
31 p_newattr = (ABTI_mutex_attr *)
ABTU_malloc(
sizeof(ABTI_mutex_attr));
34 p_newattr->attrs = ABTI_MUTEX_ATTR_NONE;
35 p_newattr->nesting_cnt = 0;
36 p_newattr->owner_id = 0;
37 p_newattr->max_handovers = ABTI_global_get_mutex_max_handovers();
38 p_newattr->max_wakeups = ABTI_global_get_mutex_max_wakeups();
41 *newattr = ABTI_mutex_attr_get_handle(p_newattr);
62 ABTI_mutex_attr *p_attr = ABTI_mutex_attr_get_ptr(h_attr);
63 ABTI_CHECK_NULL_MUTEX_ATTR_PTR(p_attr);
95 ABTI_mutex_attr *p_attr = ABTI_mutex_attr_get_ptr(attr);
96 ABTI_CHECK_NULL_MUTEX_ATTR_PTR(p_attr);
100 p_attr->attrs |= ABTI_MUTEX_ATTR_RECURSIVE;
102 p_attr->attrs &= ~ABTI_MUTEX_ATTR_RECURSIVE;
117 void ABTI_mutex_attr_print(ABTI_mutex_attr *p_attr, FILE *p_os,
int indent)
122 ABTI_mutex_attr_get_str(p_attr, attr);
123 fprintf(p_os,
"%smutex attr: %s\n", prefix, attr);
128 void ABTI_mutex_attr_get_str(ABTI_mutex_attr *p_attr,
char *p_buf)
130 if (p_attr == NULL) {
131 sprintf(p_buf,
"[NULL ATTR]");
141 p_attr->attrs, p_attr->nesting_cnt, (
void *)p_attr->owner_id);
#define ABT_MUTEX_ATTR_NULL
struct ABT_mutex_attr_opaque * ABT_mutex_attr
char * ABTU_get_indent_str(int indent)
static void * ABTU_malloc(size_t size)
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
int ABT_mutex_attr_set_recursive(ABT_mutex_attr attr, ABT_bool recursive)
Set the recursive property in the attribute object.
int ABT_mutex_attr_free(ABT_mutex_attr *attr)
Free the mutex attribute object.
int ABT_mutex_attr_create(ABT_mutex_attr *newattr)
Create a new mutex attribute object.
static void ABTU_free(void *ptr)