Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
annotate 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 |
| rev | line source |
|---|---|
| Me@19 | 1 /* |
| Me@19 | 2 * Copyright 2009 OpenSourceStewardshipFoundation.org |
| Me@19 | 3 * Licensed under GNU General Public License version 2 |
| Me@19 | 4 * |
| Me@19 | 5 * Author: seanhalle@yahoo.com |
| Me@19 | 6 */ |
| Me@19 | 7 |
| Me@19 | 8 #ifndef _PRIVATE_QUEUE_H |
| Me@19 | 9 #define _PRIVATE_QUEUE_H |
| Me@19 | 10 |
| Me@19 | 11 #include <pthread.h> |
| Me@19 | 12 |
| Me@19 | 13 #define TRUE 1 |
| Me@19 | 14 #define FALSE 0 |
| Me@19 | 15 |
| Me@19 | 16 #define LOCKED 1 |
| Me@19 | 17 #define UNLOCKED 0 |
| Me@19 | 18 |
| Me@19 | 19 |
| Me@19 | 20 /* It is the data that is shared so only need one mutex. */ |
| Me@19 | 21 typedef struct |
| Me@19 | 22 { void **insertPos; |
| Me@19 | 23 void **extractPos; |
| Me@19 | 24 void **startOfData; //data is pointers |
| Me@19 | 25 void **endOfData; //set when alloc data |
| Me@19 | 26 } |
| Me@19 | 27 PrivQueueStruc; |
| Me@19 | 28 |
| Me@19 | 29 |
| Me@19 | 30 PrivQueueStruc* makePrivQ ( ); |
| Me@19 | 31 void* readPrivQ ( PrivQueueStruc *Q ); |
| Me@19 | 32 void writePrivQ( void *in, PrivQueueStruc *Q ); |
| Me@19 | 33 int writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); //return |
| Me@19 | 34 // false when full |
| Me@19 | 35 |
| Me@19 | 36 #endif /* _PRIVATE_QUEUE_H */ |
| Me@19 | 37 |
