2013-04-20 22:54:09 +00:00
|
|
|
#ifndef GBA_THREAD_H
|
|
|
|
#define GBA_THREAD_H
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
struct GBAThread {
|
2013-04-20 23:16:37 +00:00
|
|
|
// Output
|
2013-04-20 23:40:08 +00:00
|
|
|
int started;
|
2013-04-20 22:54:09 +00:00
|
|
|
struct GBA* gba;
|
|
|
|
struct ARMDebugger* debugger;
|
2013-04-20 23:16:37 +00:00
|
|
|
|
|
|
|
// Input
|
|
|
|
struct GBAVideoRenderer* renderer;
|
2013-04-20 22:54:09 +00:00
|
|
|
int fd;
|
2013-04-21 07:35:21 +00:00
|
|
|
int activeKeys;
|
2013-04-20 23:40:08 +00:00
|
|
|
|
|
|
|
// Threading state
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
pthread_cond_t cond;
|
2013-04-20 23:44:03 +00:00
|
|
|
pthread_t thread;
|
2013-04-20 22:54:09 +00:00
|
|
|
};
|
|
|
|
|
2013-04-20 23:44:03 +00:00
|
|
|
int GBAThreadStart(struct GBAThread* threadContext);
|
|
|
|
void GBAThreadJoin(struct GBAThread* threadContext);
|
2013-04-20 22:54:09 +00:00
|
|
|
|
|
|
|
#endif
|