#include <assert.h>
#include <apr_ring.h>
#include <apr_thread_mutex.h>
#include <apr_thread_cond.h>
#include <mpm_common.h>
#include <httpd.h>
#include <http_connection.h>
#include <http_core.h>
#include <http_log.h>
#include <http_protocol.h>
#include "h2.h"
#include "h2_private.h"
#include "h2_mplx.h"
#include "h2_c2.h"
#include "h2_workers.h"
#include "h2_util.h"
Go to the source code of this file.
|
| static void *APR_THREAD_FUNC | slot_run (apr_thread_t *thread, void *wctx) |
| |
| static apr_status_t | activate_slot (h2_workers *workers) |
| |
| static void | join_zombies (h2_workers *workers) |
| |
| static void | wake_idle_worker (h2_workers *workers, ap_conn_producer_t *prod) |
| |
| static conn_rec * | get_next (h2_slot *slot) |
| |
| static void | wake_all_idles (h2_workers *workers) |
| |
| static apr_status_t | workers_pool_cleanup (void *data) |
| |
| h2_workers * | h2_workers_create (server_rec *s, apr_pool_t *pchild, int max_slots, int min_active, apr_time_t idle_limit) |
| |
| apr_uint32_t | h2_workers_get_max_workers (h2_workers *workers) |
| |
| void | h2_workers_shutdown (h2_workers *workers, int graceful) |
| |
| ap_conn_producer_t * | h2_workers_register (h2_workers *workers, apr_pool_t *producer_pool, const char *name, ap_conn_producer_next *fn_next, ap_conn_producer_done *fn_done, ap_conn_producer_shutdown *fn_shutdown, void *baton) |
| |
| apr_status_t | h2_workers_join (h2_workers *workers, ap_conn_producer_t *prod) |
| |
| apr_status_t | h2_workers_activate (h2_workers *workers, ap_conn_producer_t *prod) |
| |
◆ h2_slot
◆ h2_slot_state_t
| Enumerator |
|---|
| H2_SLOT_FREE | |
| H2_SLOT_RUN | |
| H2_SLOT_ZOMBIE | |
Definition at line 54 of file h2_workers.c.
◆ prod_state_t
| Enumerator |
|---|
| PROD_IDLE | |
| PROD_ACTIVE | |
| PROD_JOINED | |
Definition at line 36 of file h2_workers.c.
◆ activate_slot()
◆ get_next()
Get the next connection to work on.
Definition at line 199 of file h2_workers.c.
◆ h2_workers_activate()
Activate a producer. A worker will query the producer for a connection to process, once a worker is available. This may be called, irregardless of the producers active/inactive.
Definition at line 611 of file h2_workers.c.
◆ h2_workers_create()
Create a worker set with a maximum number of 'slots', e.g. worker threads to run. Always keep min_active workers running. Shutdown any additional workers after idle_secs seconds of doing nothing.
@oaram s the base server
- Parameters
-
| pool | for allocations |
| min_active | minimum number of workers to run |
| max_slots | maximum number of worker slots |
| idle_limit | upper duration of idle after a non-minimal slots shuts down |
Definition at line 422 of file h2_workers.c.
◆ h2_workers_get_max_workers()
Get the maximum number of workers.
Definition at line 538 of file h2_workers.c.
◆ h2_workers_join()
Stop retrieving more connection from the producer and wait for all ongoing for from that producer to be done.
Definition at line 589 of file h2_workers.c.
◆ h2_workers_register()
Register a new producer with the given baton and callback functions. Will allocate internal structures from the given pool (but make no use of the pool after registration). Producers are inactive on registration. See h2_workers_activate().
- Parameters
-
| producer_pool | to allocate the producer from |
| name | descriptive name of the producer, must not be unique |
| fn_next | callback for retrieving connections to process |
| fn_done | callback for processed connections |
| baton | provided value passed on in callbacks |
- Returns
- the producer instance created
Definition at line 563 of file h2_workers.c.
◆ h2_workers_shutdown()
◆ join_zombies()
◆ slot_run()
◆ wake_all_idles()
◆ wake_idle_worker()
◆ workers_pool_cleanup()