Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
view PrivateQueue.h @ 25:7742a5e0d92e
Created pure_C brch
| author | kshalle |
|---|---|
| date | Mon, 13 Feb 2012 13:29:51 -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 */
