#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include "include/macros.h"
#include "include/mc_error.h"
#include "include/mc_rwlock.h"
Go to the source code of this file.
Functions | |
int | mc_rwlock_init (mc_rwlock_p rwlock) |
int | mc_rwlock_destroy (mc_rwlock_p rwlock) |
int | mc_rwlock_rdlock (mc_rwlock_p rwlock) |
int | mc_rwlock_rdunlock (mc_rwlock_p rwlock) |
int | mc_rwlock_wrlock (mc_rwlock_p rwlock) |
int | mc_rwlock_wrunlock (mc_rwlock_p rwlock) |
int mc_rwlock_destroy | ( | mc_rwlock_p | rwlock | ) |
Definition at line 66 of file mc_rwlock.c.
References mc_rwlock_s::cond, COND_DESTROY, mc_rwlock_s::lock, and MUTEX_DESTROY.
int mc_rwlock_init | ( | mc_rwlock_p | rwlock | ) |
Definition at line 46 of file mc_rwlock.c.
References CHECK_NULL, mc_rwlock_s::cond, COND_INIT, COND_T, mc_rwlock_s::lock, MC_ERR_MEMORY, MUTEX_INIT, MUTEX_T, mc_rwlock_s::num_readers, mc_rwlock_s::write_flag, and mc_rwlock_s::write_request.
int mc_rwlock_rdlock | ( | mc_rwlock_p | rwlock | ) |
Definition at line 79 of file mc_rwlock.c.
References mc_rwlock_s::cond, COND_WAIT, mc_rwlock_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, mc_rwlock_s::num_readers, mc_rwlock_s::write_flag, and mc_rwlock_s::write_request.
int mc_rwlock_rdunlock | ( | mc_rwlock_p | rwlock | ) |
Definition at line 94 of file mc_rwlock.c.
References mc_rwlock_s::cond, COND_SIGNAL, mc_rwlock_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, and mc_rwlock_s::num_readers.
int mc_rwlock_wrlock | ( | mc_rwlock_p | rwlock | ) |
Definition at line 107 of file mc_rwlock.c.
References mc_rwlock_s::cond, COND_WAIT, mc_rwlock_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, mc_rwlock_s::num_readers, mc_rwlock_s::write_flag, and mc_rwlock_s::write_request.
int mc_rwlock_wrunlock | ( | mc_rwlock_p | rwlock | ) |
Definition at line 126 of file mc_rwlock.c.
References mc_rwlock_s::cond, COND_SIGNAL, mc_rwlock_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, and mc_rwlock_s::write_flag.