render_thread_struct.h
author Tero Marttila <terom@fixme.fi>
Sat, 30 Aug 2008 19:13:15 +0300
changeset 49 10c7dce1a043
parent 24 8307d28329ae
permissions -rw-r--r--
autogenerate the memcache_test help output, and pipeline memcache requests
#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 */