Apache Portable Runtime Utility Library
apr_thread_pool.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed
4 * with this work for additional information regarding copyright
5 * ownership. The ASF licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this file
7 * except in compliance with the License. You may obtain a copy of
8 * the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 * implied. See the License for the specific language governing
16 * permissions and limitations under the License.
17 */
18
19#ifndef APU_THREAD_POOL_H
20#define APU_THREAD_POOL_H
21
22#include "apu.h"
23#include "apr_thread_proc.h"
24
45#if APR_HAS_THREADS
46
47#ifdef __cplusplus
48extern "C" {
49#endif /* __cplusplus */
50
58typedef struct apr_thread_pool apr_thread_pool_t;
59
60#define APR_THREAD_TASK_PRIORITY_LOWEST 0
61#define APR_THREAD_TASK_PRIORITY_LOW 63
62#define APR_THREAD_TASK_PRIORITY_NORMAL 127
63#define APR_THREAD_TASK_PRIORITY_HIGH 191
64#define APR_THREAD_TASK_PRIORITY_HIGHEST 255
65
77APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me,
78 apr_size_t init_threads,
79 apr_size_t max_threads,
80 apr_pool_t *pool);
81
86APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me);
87
97APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me,
98 apr_thread_start_t func,
99 void *param,
100 apr_byte_t priority,
101 void *owner);
111APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me,
112 apr_thread_start_t func,
113 void *param,
114 apr_interval_time_t time,
115 void *owner);
116
126APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me,
127 apr_thread_start_t func,
128 void *param,
129 apr_byte_t priority,
130 void *owner);
131
142 void *owner);
143
150
157
164
171
178
187 apr_size_t cnt);
188
194APU_DECLARE(apr_size_t)
196
202APU_DECLARE(apr_size_t)
204
210APU_DECLARE(apr_size_t)
212
218APU_DECLARE(apr_size_t)
220
227
235 apr_size_t cnt);
236
247APU_DECLARE(apr_interval_time_t)
249 apr_interval_time_t timeout);
250
257APU_DECLARE(apr_interval_time_t)
259
266
274 apr_size_t val);
275
282
289APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd,
290 void **owner);
291
294#ifdef __cplusplus
295}
296#endif
297
298#endif /* APR_HAS_THREADS */
299#endif /* !APR_THREAD_POOL_H */
apr_size_t apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt)
apr_size_t apr_thread_pool_threshold_set(apr_thread_pool_t *me, apr_size_t val)
apr_interval_time_t apr_thread_pool_idle_wait_set(apr_thread_pool_t *me, apr_interval_time_t timeout)
apr_size_t apr_thread_pool_threshold_get(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_tasks_count(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_tasks_high_count(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_idle_max_get(apr_thread_pool_t *me)
apr_interval_time_t apr_thread_pool_idle_wait_get(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_threads_count(apr_thread_pool_t *me)
apr_status_t apr_thread_pool_top(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner)
apr_status_t apr_thread_pool_create(apr_thread_pool_t **me, apr_size_t init_threads, apr_size_t max_threads, apr_pool_t *pool)
apr_size_t apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt)
apr_status_t apr_thread_pool_schedule(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_interval_time_t time, void *owner)
apr_size_t apr_thread_pool_tasks_run_count(apr_thread_pool_t *me)
apr_status_t apr_thread_pool_destroy(apr_thread_pool_t *me)
struct apr_thread_pool apr_thread_pool_t
Definition: apr_thread_pool.h:58
apr_size_t apr_thread_pool_threads_high_count(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_thread_max_get(apr_thread_pool_t *me)
apr_status_t apr_thread_pool_push(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner)
apr_size_t apr_thread_pool_idle_count(apr_thread_pool_t *me)
apr_status_t apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, void *owner)
apr_status_t apr_thread_pool_task_owner_get(apr_thread_t *thd, void **owner)
apr_size_t apr_thread_pool_busy_count(apr_thread_pool_t *me)
apr_size_t apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t *me)