forked from DC-SWAT/DreamShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue.h
More file actions
48 lines (41 loc) · 1.09 KB
/
queue.h
File metadata and controls
48 lines (41 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
** $Id: queue.h 10 2007-09-15 19:37:27Z danielq $
** Queue Management: Declarations
** SoongSoft, Argentina
** http://www.soongsoft.com mailto:dq@soongsoft.com
** Copyright (C) 2003-2006 Daniel Quintela. All rights reserved.
*/
#ifndef QUE_H_INCLUDED
#define QUE_H_INCLUDED
#define QUE_NO_LIMIT -1
typedef struct _qmsg QMSG;
struct _qmsg
{
void *pMsg;
QMSG *next;
};
typedef struct _queue
{
int qMax;
void * qMutex;
#ifdef _WIN32
void * qNotEmpty;
void * qNotFull;
#elif defined(_arch_dreamcast)
semaphore_t * qNotEmpty;
semaphore_t * qNotFull;
#else
int qNotEmpty[2];
int qNotFull;
#endif
QMSG *qMsgHead;
QMSG *qMsgTail;
long msgcount;
} QUEUE;
int _QueGet(QUEUE *pQueue, void **ppMsg);
int QueGet(QUEUE *pQueue, void **ppMsg);
int QuePut(QUEUE *pQueue, void *pMsg);
int QueCreate(QUEUE *pQueue, int maxMsgs);
int QueDestroy(QUEUE *pQueue);
long GetQueNotEmptyHandle( QUEUE *pQueue);
#endif