upiwin/src/msg_queue.h

28 lines
757 B
C
Raw Normal View History

#ifndef __MSG_QUEUE_H_INCLUDED
#define __MSG_QUEUE_H_INCLUDED
#include "wintype.h"
#include "msg.h"
typedef struct tagMSG_QUEUE {
struct tagMSG_QUEUE *next;
PMSG startbound;
PMSG endbound;
PMSG head;
PMSG tail;
int nentries;
pthread_mutex_t mutex;
MSG messagestore[0];
} MSG_QUEUE, *PMSG_QUEUE;
#define PEEK_REMOVE 0x0001
#define PEEK_NOREMOVE 0x0000
extern PMSG_QUEUE MqAlloc(int nentries);
extern void MqDestroy(PMSG_QUEUE queue);
extern void MqPost(PMSG_QUEUE queue, uintptr_t target, unsigned message, const uintptr_t *attrs, int nattrs);
extern void MqPost1(PMSG_QUEUE queue, uintptr_t target, unsigned message, uintptr_t attr1);
extern int MqPeek(PMSG_QUEUE queue, PMSG msg, unsigned flags);
#endif /* __MSG_QUEUE_H_INCLUDED */