Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022 #include <glib.h>
00023 #include <mesh.h>
00024 #include <string.h>
00025
00026 #ifndef MESH_UTILS_H
00027 #define MESH_UTILS_H
00028
00029
00030
00031 #define g_strcmp ((int (*)(gconstpointer, gconstpointer)) strcmp)
00032
00033 struct mesh_fifo_t;
00034 struct depend_struct_t;
00035 typedef struct mesh_fifo_t mesh_fifo;
00036 typedef struct depend_struct_t depend_struct;
00037 struct mesh_fifo_t {
00038 gint size, capacity;
00039 mesh_thread_mutex *mutex;
00040 mesh_thread_cond *cond_insert;
00041 mesh_thread_cond *cond_remove;
00042 GSList *head;
00043 GSList *tail;
00044 };
00045
00046 struct depend_struct_t {
00047 GSList *in;
00048 GSList *out;
00049 void *(*func)(void*);
00050 void *arg;
00051 int id;
00052 };
00053
00067 GSList *mesh_get_live_threads ( mesh_scheduler *execution_scheduler );
00068
00069
00080 mesh_fifo *mesh_fifo_init(gint size);
00081
00092 mesh_fifo *mesh_fifo_insert(mesh_fifo *fifo,void *data);
00093
00104 mesh_fifo *mesh_fifo_remove(mesh_fifo *fifo,void **data);
00105
00114 int mesh_fifo_num_elements(mesh_fifo *fifo);
00115
00139 void mesh_depend(GSList *in, GSList *out,
00140 void *(*func)(void *), void *arg);
00141
00142 #endif