00001 /* synQueue - a sychronized message queue for messages between 00002 * threads. */ 00003 00004 #ifndef SYNQUEUE_H 00005 #define SYNQUEUE_H 00006 00007 struct synQueue *synQueueNew(); 00008 /* Make a new, empty, synQueue. */ 00009 00010 void synQueueFree(struct synQueue **pSq); 00011 /* Free up synQueue. Be sure no other threads are using 00012 * it first though! This will not free any dynamic memory 00013 * in the messages. Use synQueueFreeAndVals for that. */ 00014 00015 void synQueueFreeAndVals(struct synQueue **pSq); 00016 /* Free up synQueue. Be sure no other threads are using 00017 * it first though! This will freeMem all the messages */ 00018 00019 void synQueuePut(struct synQueue *sq, void *message); 00020 /* Add message to end of queue. */ 00021 00022 void *synQueueGet(struct synQueue *sq); 00023 /* Get message off start of queue. Wait until there is 00024 * a message if queue is empty. */ 00025 00026 void *synQueueGrab(struct synQueue *sq); 00027 /* Get message off start of queue. Return NULL immediately 00028 * if queue is empty. */ 00029 00030 int synQueueSize(struct synQueue *sq); 00031 /* Return number of messages currently on queue. */ 00032 00033 #endif /* SYNQUEUE_H */ 00034
1.5.2