render_thread_struct.h
author Tero Marttila <terom@fixme.fi>
Fri, 29 Aug 2008 23:31:17 +0300
changeset 48 1c67f512779b
parent 24 8307d28329ae
permissions -rw-r--r--
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
#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 */