view PrivateQueue.h @ 19:1ed562d601d9

Newly created project repository -- commit sub-states
author Me@portablequad
date Tue, 07 Feb 2012 12:51:29 -0800
parents 174a7c2ca340
children b5ae7fbb1f01 c5d2f2a94133
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 */
8 #ifndef _PRIVATE_QUEUE_H
9 #define _PRIVATE_QUEUE_H
11 #include <pthread.h>
13 #define TRUE 1
14 #define FALSE 0
16 #define LOCKED 1
17 #define UNLOCKED 0
20 /* It is the data that is shared so only need one mutex. */
21 typedef struct
22 { void **insertPos;
23 void **extractPos;
24 void **startOfData; //data is pointers
25 void **endOfData; //set when alloc data
26 }
27 PrivQueueStruc;
30 PrivQueueStruc* makePrivQ ( );
31 void* readPrivQ ( PrivQueueStruc *Q );
32 void writePrivQ( void *in, PrivQueueStruc *Q );
33 int writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); //return
34 // false when full
36 #endif /* _PRIVATE_QUEUE_H */