00001
00002
00003
00004
00005 #if !defined(_INCLUDED_SMD_WORKERS_H_HEADER__)
00006 #define _INCLUDED_SMD_WORKERS_H_HEADER__
00007
00018 typedef struct smd_worker_group_t smd_worker_group_t;
00019
00023 typedef struct smd_worker_t smd_worker_t;
00024
00028 typedef sul_error_t *(*smd_worker_fn_t)(smd_worker_t *worker, void *baton, apr_pool_t *pool);
00029
00037 sul_error_t *
00038 smd_worker_group_create(smd_worker_group_t **self, apr_pool_t *pool);
00039
00047 sul_error_t *
00048 smd_worker_group_destroy(smd_worker_group_t *group);
00049
00061 sul_error_t *
00062 smd_worker_group_launch(smd_worker_group_t *group, smd_worker_t **ptr,
00063 smd_worker_fn_t fn, void *baton, apr_size_t queue_sz,
00064 apr_pool_t *pool);
00065
00073 sul_error_t *
00074 smd_worker_group_stop(smd_worker_group_t *group, smd_worker_t *worker);
00075
00082 sul_boolean_t
00083 smd_worker_is_alive(smd_worker_t *worker);
00084
00094 apr_queue_t *
00095 smd_worker_queue(smd_worker_t *worker);
00096
00108 sul_error_t *
00109 smd_worker_hybernate(smd_worker_t *worker, apr_interval_time_t interval);
00110
00118 smd_worker_group_t *
00119 smd_worker_get_group(smd_worker_t *worker);
00120
00128 apr_thread_mutex_t *
00129 smd_worker_mutex_get(smd_worker_t *worker);
00130
00133 #endif