view PrivateQueue.h @ 7:08f0b4da7610

Works with pin2core.. not sure changes made..
author Me
date Wed, 01 Sep 2010 09:16:24 -0700
parents 09cfa875abbd
children 3562716ebdbd 1ed562d601d9
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 */