29 ABTI_rwlock *p_newrwlock;
31 p_newrwlock = (ABTI_rwlock *)
ABTU_malloc(
sizeof(ABTI_rwlock));
32 if (p_newrwlock == NULL) {
35 ABTI_rwlock_init(p_newrwlock);
39 *newrwlock = ABTI_rwlock_get_handle(p_newrwlock);
63 ABTI_rwlock *p_rwlock = ABTI_rwlock_get_ptr(h_rwlock);
64 ABTI_CHECK_NULL_RWLOCK_PTR(p_rwlock);
66 ABTI_rwlock_fini(p_rwlock);
101 ABTI_local *p_local = ABTI_local_get_local();
102 ABTI_rwlock *p_rwlock = ABTI_rwlock_get_ptr(rwlock);
103 ABTI_CHECK_NULL_RWLOCK_PTR(p_rwlock);
105 ABTI_rwlock_rdlock(&p_local, p_rwlock);
135 ABTI_local *p_local = ABTI_local_get_local();
136 ABTI_rwlock *p_rwlock = ABTI_rwlock_get_ptr(rwlock);
137 ABTI_CHECK_NULL_RWLOCK_PTR(p_rwlock);
139 ABTI_rwlock_wrlock(&p_local, p_rwlock);
165 ABTI_local *p_local = ABTI_local_get_local();
166 ABTI_rwlock *p_rwlock = ABTI_rwlock_get_ptr(rwlock);
167 ABTI_CHECK_NULL_RWLOCK_PTR(p_rwlock);
169 ABTI_rwlock_unlock(&p_local, p_rwlock);
int ABT_rwlock_create(ABT_rwlock *newrwlock)
Create a new rwlock ABT_rwlock_create creates a new rwlock object and returns its handle through newr...
static void * ABTU_malloc(size_t size)
int ABT_rwlock_unlock(ABT_rwlock rwlock)
Unlock the rwlock.
struct ABT_rwlock_opaque * ABT_rwlock
int ABT_rwlock_free(ABT_rwlock *rwlock)
Free the rwlock object.
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
int ABT_rwlock_wrlock(ABT_rwlock rwlock)
Lock the rwlock as a writer.
int ABT_rwlock_rdlock(ABT_rwlock rwlock)
Lock the rwlock as a reader.
static void ABTU_free(void *ptr)