#include "macros.h"
#include "../mc_list/list.h"
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | barrier_node_s |
struct | barrier_queue_s |
Typedefs | |
typedef struct barrier_node_s | barrier_node_t |
typedef barrier_node_t * | barrier_node_p |
typedef struct barrier_queue_s | barrier_queue_t |
typedef barrier_queue_t * | barrier_queue_p |
Functions | |
barrier_node_p | barrier_node_Initialize (int id, int num_registered) |
int | barrier_node_Destroy (barrier_node_p node) |
int | barrier_queue_Add (barrier_queue_p list, barrier_node_p node) |
int | barrier_queue_Delete (int id, barrier_queue_p list) |
int | barrier_queue_Destroy (barrier_queue_p queue) |
barrier_node_p | barrier_queue_Get (barrier_queue_p list, int id) |
barrier_queue_p | barrier_queue_New (void) |
barrier_node_p | barrier_queue_Pop (barrier_queue_p queue) |
typedef barrier_node_t* barrier_node_p |
typedef struct barrier_node_s barrier_node_t |
typedef barrier_queue_t* barrier_queue_p |
typedef struct barrier_queue_s barrier_queue_t |
int barrier_node_Destroy | ( | barrier_node_p | node | ) |
Definition at line 70 of file barrier.c.
References barrier_node_s::cond, COND_DESTROY, barrier_node_s::lock, MC_SUCCESS, and MUTEX_DESTROY.
Referenced by barrier_queue_Delete(), and barrier_queue_Destroy().
barrier_node_p barrier_node_Initialize | ( | int | id, | |
int | num_registered | |||
) |
Definition at line 45 of file barrier.c.
References CHECK_NULL, barrier_node_s::cond, COND_INIT, COND_T, barrier_node_s::id, barrier_node_s::lock, MUTEX_INIT, MUTEX_T, node, barrier_node_s::num_registered, and barrier_node_s::num_waiting.
Referenced by MC_BarrierInit().
int barrier_queue_Add | ( | barrier_queue_p | list, | |
barrier_node_p | node | |||
) |
Definition at line 87 of file barrier.c.
References DATA, barrier_node_s::id, barrier_queue_s::list, ListAdd(), list_s::listhead, barrier_queue_s::lock, MC_SUCCESS, MC_WARN_DUPLICATE, listNode_s::next, listNode_s::node_data, RWLOCK_WRLOCK, RWLOCK_WRUNLOCK, and barrier_queue_s::size.
Referenced by MC_BarrierInit().
int barrier_queue_Delete | ( | int | id, | |
barrier_queue_p | list | |||
) |
Definition at line 111 of file barrier.c.
References barrier_node_Destroy(), barrier_node_s::id, barrier_queue_s::list, ListDelete(), ListSearch(), barrier_queue_s::lock, MC_ERR_NOT_FOUND, MC_SUCCESS, RWLOCK_WRLOCK, RWLOCK_WRUNLOCK, barrier_queue_s::size, and list_s::size.
Referenced by MC_BarrierDelete().
int barrier_queue_Destroy | ( | barrier_queue_p | queue | ) |
Definition at line 131 of file barrier.c.
References barrier_node_Destroy(), barrier_queue_Pop(), barrier_queue_s::list, ListTerminate(), barrier_queue_s::lock, MC_SUCCESS, node, and RWLOCK_DESTROY.
Referenced by mc_platform_Destroy().
barrier_node_p barrier_queue_Get | ( | barrier_queue_p | list, | |
int | id | |||
) |
Definition at line 145 of file barrier.c.
References barrier_queue_s::list, list_s::listhead, barrier_queue_s::lock, listNode_s::next, listNode_s::node_data, RWLOCK_RDLOCK, and RWLOCK_RDUNLOCK.
Referenced by MC_Barrier(), and MC_BarrierInit().
barrier_queue_p barrier_queue_New | ( | void | ) |
Definition at line 162 of file barrier.c.
References CHECK_NULL, barrier_queue_s::list, ListInitialize(), barrier_queue_s::lock, RWLOCK_INIT, and RWLOCK_T.
Referenced by mc_platform_Initialize().
barrier_node_p barrier_queue_Pop | ( | barrier_queue_p | queue | ) |
Definition at line 176 of file barrier.c.
References barrier_queue_s::list, ListPop(), and node.
Referenced by barrier_queue_Destroy().