blob: 485b1bb9acff00113cff60616ca2911c1345d006 (
plain)
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
|
#ifndef _ITC_H
#define _ITC_H
#include "common.h"
typedef struct itc_message_s itc_message;
struct itc_message_s {
int number;
void *data;
itc_message *older, *newer;
};
typedef struct {
itc_message *newest, *oldest;
SDL_mutex *mutex;
SDL_sem *sem;
} itc_chan;
void itc_chan_create(itc_chan *chan);
void itc_chan_destroy(itc_chan *chan);
void itc_chan_push(itc_chan *chan, int number, void *data);
int itc_chan_pop(itc_chan *chan, int *number, void **data);
int itc_chan_pop_block(itc_chan *chan, int *number, void **data);
#endif // _ITC_H
|