#ifndef RENDER_THREAD_STRUCT_H
#define RENDER_THREAD_STRUCT_H
#include <pthread.h>
#include <event2/event_struct.h>
#include "render_thread.h"
#include "render_struct.h"
struct render_thread {
int owned_by_me;
// the thread identifier
pthread_t thread_id;
// the render op, this includes the socket/stream
struct render render_info;
// completion callback
render_thread_done_cb cb_func;
void *cb_arg;
// what fd to use for completion notification
int notify_fd;
// the notification event
struct event ev;
// did the render fail?
int err;
// already canceled/done?
int is_active;
};
int render_thread_init (struct render_thread *ctx, struct render *render_info, render_thread_done_cb cb_func, void *cb_arg);
void render_thread_cancel (struct render_thread *ctx);
void render_thread_deinit (struct render_thread *ctx);
#endif /* RENDER_THREAD_STRUCT_H */