design_pattern_for_c  V 1.00
event_threadpool.h
Go to the documentation of this file.
1 
5 #ifndef EVENT_THREADPOOL_H_
6 #define EVENT_THREADPOOL_H_
19 EventTPoolManager event_tpool_manager_new(int thread_num, int is_threadsafe, const char * plugin_path);
57 event_tpool_add_result_t event_tpool_add_thread(EventTPoolManager this, int threadid, EventSubscriber subscriber, void * arg);
78 void event_tpool_del(EventTPoolManager this, int fd);
79 
87 
93 void event_tpool_set_stack_size(size_t stack_size);
95 #endif
EventTPoolManager event_tpool_manager_new(int thread_num, int is_threadsafe, const char *plugin_path)
new EventTPoolManager
void event_tpool_manager_free(EventTPoolManager this)
destructor of EventTPoolManager
size_t event_tpool_manager_get_threadnum(EventTPoolManager this)
get size of thread
event_tpool_add_result_t event_tpool_add(EventTPoolManager this, EventSubscriber subscriber, void *arg)
add EventSubscriber to threadpool
EventTPoolManager class instance definition.
This is API as ThreadPool data definition for ThreadPooldesign petten by using libevent.
event_tpool_add_result_t event_tpool_add_thread(EventTPoolManager this, int threadid, EventSubscriber subscriber, void *arg)
add EventSubscriber to threadpool, if you want to choose thead, please use it.
void event_tpool_set_stack_size(size_t stack_size)
Set thread stack size.
EventSubscriber class instance definition, this is storaged in any threads.
void event_tpool_del(EventTPoolManager this, int fd)
delete EventSubscriber to threadapool.
event_tpool_add_result_t event_tpool_update(EventTPoolManager this, EventTPoolThreadInfo event_handle, EventSubscriber subscriber, void *arg)
update EventSubscriber to threadpool.
add result definition
void event_tpool_atfork_child(EventTPoolManager this)
Update member at fork, please call this API on child process if you use fork.