CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
prqueue.h File Reference

Lock-free pointer FIFO queue. More...

#include <cx/cx.h>
#include <cx/thread/aspin.h>
#include <cx/thread/atomic.h>
#include <cx/thread/mutex.h>

Go to the source code of this file.

Data Structures

struct  PrQueue
 

Typedefs

typedef enum PrqGrowthEnum PrqGrowth
 How much a dynamic PrQueue grows or shrinks by when it resizes.
 
typedef struct PrQueue PrQueue
 

Enumerations

enum  PrqGrowthEnum {
  PRQ_Grow_None = 1 , PRQ_Grow_25 , PRQ_Grow_50 , PRQ_Grow_100 ,
  PRQ_Grow_150 , PRQ_Grow_200
}
 How much a dynamic PrQueue grows or shrinks by when it resizes. More...
 

Functions

void prqInitFixed (PrQueue *prq, uint32 sz)
 
void prqInitDynamic (PrQueue *prq, uint32 minsz, uint32 targetsz, uint32 maxsz, PrqGrowth growth, PrqGrowth shrink)
 
bool prqDestroy (PrQueue *prq)
 
bool prqPush (PrQueue *prq, void *ptr)
 
void * prqPop (PrQueue *prq)
 
bool prqCollect (PrQueue *prq)
 
uint32 prqCount (PrQueue *prq)
 
void * prqPeek (PrQueue *prq, uint32 n)
 

Detailed Description

Lock-free pointer FIFO queue.

Definition in file prqueue.h.