diff options
Diffstat (limited to 'src/itc.h')
-rw-r--r-- | src/itc.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/itc.h b/src/itc.h new file mode 100644 index 0000000..485b1bb --- /dev/null +++ b/src/itc.h @@ -0,0 +1,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 |