Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
view PrivateQueue.h @ 41:8fcbe46de60a
bugfixes - peek and enlarge now working properly
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 19 Dec 2012 15:38:08 +0100 |
| parents | cb29e773f76f |
| children | 179144f26c9d |
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
12 #include "VMS_impl/VMS_primitive_data_types.h"
13 #include "VMS_impl/Services_Offered_by_VMS/Memory_Handling/vmalloc.h"
16 #define TRUE 1
17 #define FALSE 0
19 #define LOCKED 1
20 #define UNLOCKED 0
22 #define DEBUG_PRIVATE_Q
24 /* It is the data that is shared so only need one mutex. */
25 typedef struct
26 { void **insertPos;
27 void **extractPos;
28 void **startOfData; //data is pointers
29 void **endOfData; //set when alloc data
30 #ifdef DEBUG_PRIVATE_Q
31 int numWrites;
32 int numReads;
33 #endif
34 }
35 PrivQueueStruc;
37 PrivQueueStruc* makePrivQ ( );
38 bool32 isEmptyPrivQ ( PrivQueueStruc *Q ); //ret TRUE if empty
39 void* peekPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
40 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
41 void writePrivQ( void *in, PrivQueueStruc *Q );
42 //return false when full
43 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q );
44 int32 numInPrivQ( PrivQueueStruc *Q );
45 void pushPrivQ( void * in, PrivQueueStruc* Q );
46 void freePrivQ( PrivQueueStruc *Q );
48 #endif /* _PRIVATE_QUEUE_H */
