Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
comparison PrivateQueue.h @ 14:447e97a52426
added zeroing out private queue when created
| author | Me |
|---|---|
| date | Thu, 04 Nov 2010 17:56:08 -0700 |
| parents | 174a7c2ca340 |
| children | 3134d8a1e8e3 |
comparison
equal
deleted
inserted
replaced
| 2:d23cd59a6684 | 3:9fe956654b23 |
|---|---|
| 7 | 7 |
| 8 #ifndef _PRIVATE_QUEUE_H | 8 #ifndef _PRIVATE_QUEUE_H |
| 9 #define _PRIVATE_QUEUE_H | 9 #define _PRIVATE_QUEUE_H |
| 10 | 10 |
| 11 #include <pthread.h> | 11 #include <pthread.h> |
| 12 #include "../VMS_primitive_data_types.h" | |
| 12 | 13 |
| 13 #define TRUE 1 | 14 #define TRUE 1 |
| 14 #define FALSE 0 | 15 #define FALSE 0 |
| 15 | 16 |
| 16 #define LOCKED 1 | 17 #define LOCKED 1 |
| 17 #define UNLOCKED 0 | 18 #define UNLOCKED 0 |
| 18 | 19 |
| 19 | 20 |
| 20 /* It is the data that is shared so only need one mutex. */ | |
| 21 typedef struct | 21 typedef struct |
| 22 { void **insertPos; | 22 { void **insertPos; |
| 23 void **extractPos; | 23 void **extractPos; |
| 24 void **startOfData; //data is pointers | 24 void **startOfData; //data is pointers |
| 25 void **endOfData; //set when alloc data | 25 void **endOfData; //set when alloc data |
| 28 | 28 |
| 29 | 29 |
| 30 PrivQueueStruc* makePrivQ ( ); | 30 PrivQueueStruc* makePrivQ ( ); |
| 31 void* readPrivQ ( PrivQueueStruc *Q ); | 31 void* readPrivQ ( PrivQueueStruc *Q ); |
| 32 void writePrivQ( void *in, PrivQueueStruc *Q ); | 32 void writePrivQ( void *in, PrivQueueStruc *Q ); |
| 33 int writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); //return | 33 int32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); //return |
| 34 // false when full | 34 // false when full |
| 35 int32 numInPrivQ( PrivQueueStruc *Q ); | |
| 36 | |
| 35 | 37 |
| 36 #endif /* _PRIVATE_QUEUE_H */ | 38 #endif /* _PRIVATE_QUEUE_H */ |
| 37 | 39 |
