20 lines
413 B
C
20 lines
413 B
C
#ifndef __PT_QUEUE_H__
|
|
#define __PT_QUEUE_H__
|
|
|
|
typedef struct ptQueueElem {
|
|
_Atomic(struct ptQueueElem*) nextEl;
|
|
_Atomic(void*) payload;
|
|
} ptQueueElem;
|
|
|
|
|
|
typedef struct {
|
|
_Atomic(ptQueueElem*) head;
|
|
_Atomic(ptQueueElem*) tail;
|
|
} ptQueue;
|
|
|
|
|
|
int ptQueuePush(ptQueue* q, void* payload, char* errbuf);
|
|
ptQueue* ptQueueCreate(char* errbuf);
|
|
void ptQueueFree(ptQueue* q);
|
|
|
|
#endif //ifndef __PT_QUEUE_H__
|