93 #define NS_JOB_NONE 0x0
115 #define NS_JOB_ACCEPT 0x1
126 #define NS_JOB_CONNECT 0x2
137 #define NS_JOB_READ 0x4
148 #define NS_JOB_WRITE 0x8
159 #define NS_JOB_TIMER 0x10
170 #define NS_JOB_SIGNAL 0x20
193 #define NS_JOB_PERSIST 0x40
212 #define NS_JOB_THREAD 0x80
221 #define NS_JOB_PRESERVE_FD 0x100
240 #define NS_JOB_DISABLE_ONLY 0x200
265 #define NS_JOB_IS_ACCEPT(eee) ((eee)&NS_JOB_ACCEPT)
270 #define NS_JOB_IS_READ(eee) ((eee)&NS_JOB_READ)
275 #define NS_JOB_IS_CONNECT(eee) ((eee)&NS_JOB_CONNECT)
280 #define NS_JOB_IS_WRITE(eee) ((eee)&NS_JOB_WRITE)
285 #define NS_JOB_IS_TIMER(eee) ((eee)&NS_JOB_TIMER)
290 #define NS_JOB_IS_SIGNAL(eee) ((eee)&NS_JOB_SIGNAL)
295 #define NS_JOB_IS_PERSIST(eee) ((eee)&NS_JOB_PERSIST)
300 #define NS_JOB_IS_IO(eee) (NS_JOB_IS_ACCEPT(eee)||NS_JOB_IS_READ(eee)||NS_JOB_IS_CONNECT(eee)||NS_JOB_IS_WRITE(eee))
305 #define NS_JOB_IS_THREAD(eee) ((eee)&NS_JOB_THREAD)
310 #define NS_JOB_IS_PRESERVE_FD(eee) ((eee)&NS_JOB_PRESERVE_FD)
315 #define NS_JOB_IS_DISABLE_ONLY(eee) ((eee)&NS_JOB_DISABLE_ONLY)
320 #define NS_JOB_SET_READ(eee) ((eee) |= NS_JOB_READ)
324 #define NS_JOB_SET_WRITE(eee) ((eee) |= NS_JOB_WRITE)
328 #define NS_JOB_SET_THREAD(eee) ((eee) |= NS_JOB_THREAD)
332 #define NS_JOB_UNSET_READ(eee) ((eee) &= ~NS_JOB_READ)
336 #define NS_JOB_UNSET_WRITE(eee) ((eee) &= ~NS_JOB_WRITE)
340 #define NS_JOB_UNSET_THREAD(eee) ((eee) &= ~NS_JOB_THREAD)
344 #define NS_JOB_UNSET_DISABLE_ONLY(eee) ((eee) &= ~NS_JOB_DISABLE_ONLY)
380 void* (*malloc_fct)(size_t);
381 void* (*calloc_fct)(size_t, size_t);
382 void* (*realloc_fct)(
void *, size_t);
PRStatus ns_thrpool_wait(struct ns_thrpool_t *tp)
ns_job_type_t ns_job_get_output_type(struct ns_job_t *job)
PRStatus ns_add_signal_job(ns_thrpool_t *tp, PRInt32 signum, ns_job_type_t job_type, ns_job_func_t func, void *data, struct ns_job_t **job)
void(* ns_job_func_t)(struct ns_job_t *)
Definition: nunc-stans.h:82
void ns_job_done(struct ns_job_t *job)
void(* log_close_fct)()
Definition: nunc-stans.h:377
PRUint32 event_queue_size
Definition: nunc-stans.h:371
void ns_thrpool_shutdown(struct ns_thrpool_t *tp)
PRStatus ns_add_io_timeout_job(struct ns_thrpool_t *tp, PRFileDesc *fd, struct timeval *tv, ns_job_type_t job_type, ns_job_func_t func, void *data, struct ns_job_t **job)
PRInt32 max_threads
Definition: nunc-stans.h:369
PRFileDesc * ns_job_get_fd(struct ns_job_t *job)
struct ns_thrpool_t * ns_thrpool_new(struct ns_thrpool_config *config)
void ns_job_rearm(struct ns_job_t *job)
void(* log_start_fct)()
Definition: nunc-stans.h:376
PRStatus ns_add_io_job(struct ns_thrpool_t *tp, PRFileDesc *fd, ns_job_type_t job_type, ns_job_func_t func, void *data, struct ns_job_t **job)
Definition: nunc-stans.h:364
void ns_job_modify(struct ns_job_t *job, ns_job_type_t job_type)
void * ns_job_get_data(struct ns_job_t *job)
PRUint32 stacksize
Definition: nunc-stans.h:370
void ns_thrpool_destroy(struct ns_thrpool_t *tp)
PRInt32 ns_thrpool_is_shutdown(struct ns_thrpool_t *tp)
void(* log_fct)(int, const char *, va_list)
Definition: nunc-stans.h:375
PRStatus ns_add_job(ns_thrpool_t *tp, ns_job_type_t job_type, ns_job_func_t func, void *data, struct ns_job_t **job)
ns_job_type_t ns_job_get_type(struct ns_job_t *job)
PRStatus ns_add_timeout_job(struct ns_thrpool_t *tp, struct timeval *tv, ns_job_type_t job_type, ns_job_func_t func, void *data, struct ns_job_t **job)
struct ns_thrpool_t ns_thrpool_t
Definition: nunc-stans.h:61
unsigned short ns_job_type_t
Definition: nunc-stans.h:259
void(* free_fct)(void *)
Definition: nunc-stans.h:383
void ns_thrpool_config_init(struct ns_thrpool_config *tp_config)
PRUint32 work_queue_size
Definition: nunc-stans.h:372
ns_thrpool_t * ns_job_get_tp(struct ns_job_t *job)
PRInt32 initial_threads
Definition: nunc-stans.h:368