/home/dko/projects/mobilec/trunk/src/mc_sync/sync_list.h

Go to the documentation of this file.
00001 /* CondList is a list of condition variables. Agents may set their own
00002  * condition variables, which other entities (agents, binary api) may signal.
00003  * */
00004 
00005 #ifndef _COND_LIST_H_
00006 #define _COND_LIST_H_
00007 #include "../include/macros.h"
00008 #include "../mc_list/list.h"
00009 #include "../include/mc_rwlock.h"
00010 
00011 /* CondlistNode_t */
00012 
00013 typedef struct syncListNode_s {
00014     MUTEX_T *lock;
00015     COND_T *cond;
00016     SEMAPHORE_T *sem;
00017     int id;
00018     int signalled;
00019 }syncListNode_t;
00020 typedef syncListNode_t* syncListNode_p;
00021 
00022 /* CondList */
00023 typedef struct syncList_s {
00024     RWLOCK_T *lock; /* Protects the list */
00025     MUTEX_T *giant_lock; /* Higher level lock: used to protect series
00026                             of list operations */
00027     list_p list;
00028     int size;
00029 }syncList_t;
00030 typedef syncList_t* syncList_p;
00031 
00032 int syncListNodeInit(struct syncListNode_s *node);
00033 int syncListNodeDestroy(struct syncListNode_s *node);
00034 syncListNode_t *syncListFind(int id, struct syncList_s *list);
00035 struct syncListNode_s* syncListNodeNew(void);
00036 
00037 int syncListDelete(int id, struct syncList_s *list);
00038 syncListNode_t* syncListRemove(int id, struct syncList_s *list);
00039 struct syncList_s* syncListInit(void);
00040 int syncListAddNode(struct syncListNode_s *node, struct syncList_s *list);
00041 int syncListNew(int id, struct syncList_s *list);
00042 syncListNode_t* syncListGet(int id, struct syncList_s *list);
00043 
00044 
00045 #endif

Generated on Fri May 16 14:49:54 2008 for Mobile-C by  doxygen 1.5.4