27#define TASK_PRIORITY_SEGS 4
28#define TASK_PRIORITY_SEG(x) (((x)->dispatch.priority & 0xFF) / 64)
139 if (!
me->scheduled_tasks) {
144 if (!
me->recycled_tasks) {
149 if (!
me->busy_thds) {
154 if (!
me->idle_thds) {
159 if (!
me->dead_thds) {
164 if (!
me->recycled_thds) {
188 if (
me->scheduled_task_cnt > 0) {
196 --
me->scheduled_task_cnt;
202 if (
me->task_cnt == 0) {
256 elt->current_owner =
NULL;
257 elt->signal_work_done = 0;
302 elt->current_owner =
task->owner;
306 if (!
me->terminated) {
314 elt->current_owner =
NULL;
315 if (elt->signal_work_done) {
316 elt->signal_work_done = 0;
319 }
while (elt->state !=
TH_STOP);
328 || (
me->idle_cnt >=
me->idle_max
329 && (
me->idle_max || !
me->scheduled_task_cnt)
330 && !
me->idle_wait)) {
345 if (
me->scheduled_task_cnt)
347 else if (
me->idle_cnt >
me->idle_max) {
364 if (--
me->thd_cnt == 0 &&
me->terminated) {
440 if (tp->thd_cnt > tp->thd_high) {
441 tp->thd_high = tp->thd_cnt;
496 t->dispatch.priority = priority;
516 if (
me->task_idx[
seg]) {
520 while (
t_next->dispatch.priority >
t->dispatch.priority) {
530 for (next =
seg - 1; next >= 0; next--) {
531 if (
me->task_idx[next]) {
558 if (
me->terminated) {
575 if (
t->dispatch.time <
t_loc->dispatch.time) {
576 ++
me->scheduled_task_cnt;
585 ++
me->scheduled_task_cnt;
593 if (0 ==
me->thd_cnt) {
597 if (
me->thd_cnt >
me->thd_high)
598 me->thd_high =
me->thd_cnt;
618 if (
me->terminated) {
640 t_loc &&
t_loc->dispatch.priority >=
t->dispatch.priority) {
653 if (
me->task_cnt >
me->tasks_high)
654 me->tasks_high =
me->task_cnt;
655 if (0 ==
me->thd_cnt || (0 ==
me->idle_cnt &&
me->thd_cnt <
me->thd_max &&
656 me->task_cnt >
me->threshold)) {
660 if (
me->thd_cnt >
me->thd_high)
661 me->thd_high =
me->thd_cnt;
710 if (!owner ||
t_loc->owner == owner) {
711 --
me->scheduled_task_cnt;
728 if (!owner ||
t_loc->owner == owner) {
757 if (owner ? owner != elt->current_owner : !elt->
current_owner) {
773 elt->signal_work_done = 1;
791 if (
me->task_cnt > 0) {
794 if (
me->scheduled_task_cnt > 0) {
813 return me->scheduled_task_cnt;
834 return me->tasks_run;
840 return me->tasks_high;
852 return me->thd_timed_out;
864 return me->idle_wait;
895 for (
i = 0;
i < *
cnt; ++
i) {
982 return me->threshold;
1013 *owner =
task->owner;
APR Portability Routines.
APU_DECLARE(void)
Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
APR Condition Variable Routines.
int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
const char int apr_pool_t * pool
apr_interval_time_t apr_pollcb_cb_t func
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
#define APR_RING_ENTRY(elem)
#define APR_RING_INSERT_TAIL(hp, nep, elem, link)
#define APR_RING_INIT(hp, elem, link)
#define APR_RING_HEAD(head, elem)
#define APR_RING_SENTINEL(hp, elem, link)
#define APR_RING_INSERT_BEFORE(lep, nep, link)
#define APR_RING_LAST(hp)
#define APR_RING_EMPTY(hp, elem, link)
#define APR_RING_REMOVE(ep, link)
#define APR_RING_FIRST(hp)
#define APR_RING_NEXT(ep, link)
#define APR_RING_ELEM_INIT(ep, link)
void *(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
apr_int64_t apr_interval_time_t
static apr_status_t dispatch(md_store_fs_t *s_fs, md_store_fs_ev_t ev, unsigned int group, const char *fname, apr_filetype_e ftype, apr_pool_t *p)
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
apr_os_thread_t apr_os_thread_current()
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t(*cleanup)(void *), apr_thread_t *thread)
apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *pool)