Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

Threads and Process Functions

Collaboration diagram for Threads and Process Functions:


Modules

 Other Child Flags

Data Structures

struct  apr_proc_t

Defines

#define APR_PROC_CHECK_EXIT(x)   (x & APR_PROC_EXIT)
#define APR_PROC_CHECK_SIGNALED(x)   (x & APR_PROC_SIGNAL)
#define APR_PROC_CHECK_CORE_DUMP(x)   (x & APR_PROC_SIGNAL_CORE)
#define APR_NO_PIPE   0
#define APR_FULL_BLOCK   1
#define APR_FULL_NONBLOCK   2
#define APR_PARENT_BLOCK   3
#define APR_CHILD_BLOCK   4
#define APR_LIMIT_CPU   0
#define APR_LIMIT_MEM   1
#define APR_LIMIT_NPROC   2
#define APR_LIMIT_NOFILE   3
#define APR_PROC_DETACH_FOREGROUND   0
#define APR_PROC_DETACH_DAEMONIZE   1

Typedefs

typedef apr_proc_t apr_proc_t
typedef void( apr_child_errfn_t )(apr_pool_t *proc, apr_status_t err, const char *description)
typedef apr_thread_t apr_thread_t
typedef apr_threadattr_t apr_threadattr_t
typedef apr_procattr_t apr_procattr_t
typedef apr_thread_once_t apr_thread_once_t
typedef apr_threadkey_t apr_threadkey_t
typedef apr_other_child_rec_t apr_other_child_rec_t
typedef void *(APR_THREAD_FUNC * apr_thread_start_t )(apr_thread_t *, void *)

Enumerations

enum  apr_cmdtype_e {
  APR_SHELLCMD, APR_PROGRAM, APR_PROGRAM_ENV, APR_PROGRAM_PATH,
  APR_SHELLCMD_ENV
}
enum  apr_wait_how_e { APR_WAIT, APR_NOWAIT }
enum  apr_exit_why_e { APR_PROC_EXIT = 1, APR_PROC_SIGNAL = 2, APR_PROC_SIGNAL_CORE = 4 }
enum  apr_kill_conditions_e {
  APR_KILL_NEVER, APR_KILL_ALWAYS, APR_KILL_AFTER_TIMEOUT, APR_JUST_WAIT,
  APR_KILL_ONLY_ONCE
}

Functions

 APR_DECLARE (apr_status_t) apr_procattr_create(apr_procattr_t **new_attr
 APR_DECLARE (void) apr_proc_other_child_register(apr_proc_t *proc

Variables

apr_pool_tcont
apr_int32_t in
apr_int32_t apr_int32_t out
apr_int32_t apr_int32_t apr_int32_t err
apr_file_tchild_in
apr_file_t apr_file_tparent_in
apr_file_tchild_out
apr_file_t apr_file_tparent_out
apr_file_tchild_err
apr_file_t apr_file_tparent_err
const char * dir
apr_cmdtype_e cmd
apr_int32_t detach
apr_child_errfn_terrfn
apr_int32_t chk
const char * progname
const char const char *const * args
const char const char *const
const char *const * 
env
const char const char *const
const char *const apr_procattr_t
attr
intexitcode
int apr_exit_why_eexitwhy
int apr_exit_why_e apr_wait_how_e waithow
int apr_exit_why_e apr_wait_how_e
apr_pool_t
p
void(* maintenance )(int reason, void *, int status)
void(*) void data )
void(*) void apr_file_t write_fd )
int reason
int int status
int sig
apr_proc_tproc
apr_proc_t apr_kill_conditions_e how
int status

Define Documentation

#define APR_CHILD_BLOCK   4
 

See also:
apr_procattr_io_set

Definition at line 88 of file apr_thread_proc.h.

Referenced by cgi_handler(), cgid_server(), init_ext_filter_process(), and test_pipe_writefull().

#define APR_FULL_BLOCK   1
 

See also:
apr_procattr_io_set

Definition at line 82 of file apr_thread_proc.h.

Referenced by cgid_server(), create_uncompress_child(), include_cmd(), log_child(), rewritemap_program_child(), ssl_pipe_child_create(), ssl_util_ppopen(), and test_create_proc().

#define APR_FULL_NONBLOCK   2
 

See also:
apr_procattr_io_set

Definition at line 84 of file apr_thread_proc.h.

Referenced by apr_create_nt_pipe().

#define APR_LIMIT_CPU   0
 

See also:
apr_procattr_limit_set

Definition at line 91 of file apr_thread_proc.h.

Referenced by run_cgi_child(), and set_resource_limits().

#define APR_LIMIT_MEM   1
 

See also:
apr_procattr_limit_set

Definition at line 93 of file apr_thread_proc.h.

Referenced by run_cgi_child(), and set_resource_limits().

#define APR_LIMIT_NOFILE   3
 

See also:
apr_procattr_limit_set

Definition at line 97 of file apr_thread_proc.h.

#define APR_LIMIT_NPROC   2
 

See also:
apr_procattr_limit_set

Definition at line 95 of file apr_thread_proc.h.

Referenced by run_cgi_child(), and set_resource_limits().

#define APR_NO_PIPE   0
 

See also:
apr_procattr_io_set

Definition at line 79 of file apr_thread_proc.h.

Referenced by cgid_server(), create_uncompress_child(), include_cmd(), log_child(), rewritemap_program_child(), ssl_pipe_child_create(), and test_create_proc().

#define APR_PARENT_BLOCK   3
 

See also:
apr_procattr_io_set

Definition at line 86 of file apr_thread_proc.h.

#define APR_PROC_CHECK_CORE_DUMP x   )     (x & APR_PROC_SIGNAL_CORE)
 

did we get core

Definition at line 76 of file apr_thread_proc.h.

#define APR_PROC_CHECK_EXIT x   )     (x & APR_PROC_EXIT)
 

did we exit the process

Definition at line 72 of file apr_thread_proc.h.

#define APR_PROC_CHECK_SIGNALED x   )     (x & APR_PROC_SIGNAL)
 

did we get a signal

Definition at line 74 of file apr_thread_proc.h.

#define APR_PROC_DETACH_DAEMONIZE   1
 

Detach

Definition at line 602 of file apr_thread_proc.h.

Referenced by beos_pre_config(), leader_pre_config(), perchild_pre_config(), prefork_pre_config(), and worker_pre_config().

#define APR_PROC_DETACH_FOREGROUND   0
 

Do not detach

Definition at line 601 of file apr_thread_proc.h.

Referenced by beos_pre_config(), leader_pre_config(), perchild_pre_config(), prefork_pre_config(), and worker_pre_config().


Typedef Documentation

typedef void( apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, const char *description)
 

The prototype for APR child errfn functions. (See the description of apr_procattr_child_errfn_set() for more information.) It is passed the following parameters:

Parameters:
pool Pool associated with the apr_proc_t. If your child error function needs user data, associate it with this pool.
err APR error code describing the error
description Text description of type of processing which failed

Definition at line 162 of file apr_thread_proc.h.

typedef struct apr_other_child_rec_t apr_other_child_rec_t
 

Opaque record of child process.

Definition at line 181 of file apr_thread_proc.h.

typedef struct apr_proc_t apr_proc_t
 

The APR process type

typedef struct apr_procattr_t apr_procattr_t
 

Opaque Process attributes structure.

Definition at line 172 of file apr_thread_proc.h.

typedef struct apr_thread_once_t apr_thread_once_t
 

Opaque control variable for one-time atomic variables.

Definition at line 175 of file apr_thread_proc.h.

typedef void*(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
 

The prototype for any APR thread worker functions.

Definition at line 186 of file apr_thread_proc.h.

typedef struct apr_thread_t apr_thread_t
 

Opaque Thread structure.

Definition at line 166 of file apr_thread_proc.h.

typedef struct apr_threadattr_t apr_threadattr_t
 

Opaque Thread attributes structure.

Definition at line 169 of file apr_thread_proc.h.

typedef struct apr_threadkey_t apr_threadkey_t
 

Opaque thread private address space.

Definition at line 178 of file apr_thread_proc.h.


Enumeration Type Documentation

enum apr_cmdtype_e
 

Enumeration values:
APR_SHELLCMD  use the shell to invoke the program
APR_PROGRAM  invoke the program directly, no copied env
APR_PROGRAM_ENV  invoke the program, replicating our environment
APR_PROGRAM_PATH  find program on PATH, use our environment
APR_SHELLCMD_ENV  use the shell to invoke the program, replicating our environment

Definition at line 45 of file apr_thread_proc.h.

enum apr_exit_why_e
 

Enumeration values:
APR_PROC_EXIT  process exited normally
APR_PROC_SIGNAL  process exited due to a signal
APR_PROC_SIGNAL_CORE  process exited and dumped a core file

Definition at line 65 of file apr_thread_proc.h.

enum apr_kill_conditions_e
 

Enumeration values:
APR_KILL_NEVER  process is never sent any signals
APR_KILL_ALWAYS  process is sent SIGKILL on apr_pool_t cleanup
APR_KILL_AFTER_TIMEOUT  SIGTERM, wait 3 seconds, SIGKILL
APR_JUST_WAIT  wait forever for the process to complete
APR_KILL_ONLY_ONCE  send SIGTERM and then wait

Definition at line 188 of file apr_thread_proc.h.

enum apr_wait_how_e
 

Enumeration values:
APR_WAIT  wait for the specified process to finish
APR_NOWAIT  do not wait -- just see if it has finished

Definition at line 55 of file apr_thread_proc.h.


Function Documentation

APR_DECLARE void   ) 
 

Register an other_child -- a child associated to its registered maintence callback. This callback is invoked when the process dies, is disconnected or disappears.

Parameters:
proc The child process to register.
maintenance maintenance is a function that is invoked with a reason and the data pointer passed here.
data Opaque context data passed to the maintenance function.
write_fd An fd that is probed for writing. If it is ever unwritable then the maintenance is invoked with reason OC_REASON_UNWRITABLE.
p The pool to use for allocating memory.
Bug:
write_fd duplicates the proc->out stream, it's really redundant and should be replaced in the APR 1.0 API with a bitflag of which proc->in/out/err handles should be health checked.

no platform currently tests the pipes health.

Definition at line 131 of file apr_pools.c.

APR_DECLARE apr_status_t   ) 
 

Create and initialize a new procattr variable

Parameters:
new_attr The newly created procattr.
cont The pool to use

Definition at line 24 of file netware/dso.c.


Variable Documentation

const char const char* const* args
 

Definition at line 533 of file apr_thread_proc.h.

const char const char* const const char* const apr_procattr_t* attr
 

Definition at line 533 of file apr_thread_proc.h.

apr_file_t* child_err
 

Definition at line 426 of file apr_thread_proc.h.

apr_file_t* child_in
 

Definition at line 398 of file apr_thread_proc.h.

apr_file_t* child_out
 

Definition at line 412 of file apr_thread_proc.h.

apr_int32_t chk
 

Definition at line 506 of file apr_thread_proc.h.

apr_cmdtype_e cmd
 

Definition at line 451 of file apr_thread_proc.h.

const char const char* const const char* const apr_procattr_t apr_pool_t* cont
 

Definition at line 533 of file apr_thread_proc.h.

void(*) void data)
 

Definition at line 633 of file apr_thread_proc.h.

apr_int32_t detach
 

Definition at line 459 of file apr_thread_proc.h.

const char* dir
 

Definition at line 437 of file apr_thread_proc.h.

const char const char* const const char* const* env
 

Definition at line 533 of file apr_thread_proc.h.

apr_int32_t apr_int32_t apr_int32_t err
 

Definition at line 382 of file apr_thread_proc.h.

Referenced by AP_DECLARE(), ap_parse_vhost_addrs(), ap_proxy_connect_handler(), ap_proxy_ftp_canon(), ap_proxy_ftp_handler(), ap_proxy_http_canon(), ap_proxy_http_determine_connection(), ap_set_listenbacklog(), ap_set_listener(), ap_set_send_buffer_size(), APR_DECLARE(), APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(), cmd_rewritecond(), cmd_rewritecond_parseflagfield(), cmd_rewriterule(), cmd_rewriterule_parseflagfield(), DAV_DECLARE(), DAV_DECLARE_NONSTD(), dav_fs_add_locknull_state(), dav_fs_append_locks(), dav_fs_copy_resource(), dav_fs_copymove_file(), dav_fs_copymove_resource(), dav_fs_copymove_walker(), dav_fs_copymoveset(), dav_fs_dbm_error(), dav_fs_find_lock(), dav_fs_get_locks(), dav_fs_has_locks(), dav_fs_internal_walk(), dav_fs_load_lock_record(), dav_fs_load_locknull_list(), dav_fs_move_resource(), dav_fs_really_open_lockdb(), dav_fs_refresh_locks(), dav_fs_remove_lock(), dav_fs_remove_locknull_member(), dav_fs_remove_locknull_state(), dav_fs_remove_resource(), dav_fs_resolve(), dav_fs_save_lock_record(), dav_fs_save_locknull_list(), dav_fs_walker(), dav_gen_supported_live_props(), dav_gen_supported_reports(), dav_get_resource(), dav_insert_coreprop(), dav_label_walker(), dav_lock_walker(), dav_method_bind(), dav_method_checkin(), dav_method_checkout(), dav_method_copymove(), dav_method_delete(), dav_method_get(), dav_method_label(), dav_method_lock(), dav_method_make_activity(), dav_method_make_workspace(), dav_method_merge(), dav_method_mkcol(), dav_method_options(), dav_method_post(), dav_method_propfind(), dav_method_proppatch(), dav_method_put(), dav_method_report(), dav_method_search(), dav_method_uncheckout(), dav_method_unlock(), dav_method_update(), dav_method_vsn_control(), dav_propdb_close(), dav_propdb_first_name(), dav_propdb_get_rollback(), dav_propdb_next_name(), dav_propdb_open(), dav_propdb_output_value(), dav_propfind_walker(), dav_really_open_db(), main(), make_child(), pipeblock(), pipenonblock(), proxy_get_host_of_request(), proxysection(), read_connection(), RegisterAppWithWinSock(), set_access_name(), set_daemons_to_start(), set_keep_alive(), set_keep_alive_max(), set_keep_alive_timeout(), set_max_clients(), set_max_free_servers(), set_max_free_threads(), set_max_requests_per_thread(), set_max_spare_threads(), set_max_streaming_buffer(), set_max_threads(), set_min_free_servers(), set_min_free_threads(), set_min_spare_threads(), set_num_daemons(), set_secure_listener(), set_secure_upgradeable_listener(), set_server_limit(), set_suexec_ugid(), set_thread_limit(), set_thread_stacksize(), set_threads_limit(), set_threads_per_child(), set_threads_to_start(), ssl_cmd_SSLMutex(), ssl_cmd_SSLPassPhraseDialog(), SSL_CTX_use_certificate_chain(), ssl_log_ssl_error(), start_connect(), test(), util_ldap_set_cert_auth(), util_ldap_set_cert_type(), and util_ldap_set_connection_timeout().

apr_child_errfn_t* errfn
 

Definition at line 491 of file apr_thread_proc.h.

int * exitcode
 

Definition at line 596 of file apr_thread_proc.h.

Referenced by main().

int apr_exit_why_e * exitwhy
 

Definition at line 596 of file apr_thread_proc.h.

Referenced by ap_mpm_run(), and server_main_loop().

apr_proc_t apr_kill_conditions_e how
 

Definition at line 723 of file apr_thread_proc.h.

apr_int32_t in
 

Definition at line 382 of file apr_thread_proc.h.

Referenced by grep_or_recurse(), hold_console_open_on_error(), main(), SSL_X509_INFO_load_file(), and string_strtoi64().

void(* maintenance)(int reason, void *, int status)
 

apr_int32_t apr_int32_t out
 

Definition at line 382 of file apr_thread_proc.h.

void(*) void apr_file_t apr_pool_t p)
 

Definition at line 633 of file apr_thread_proc.h.

apr_file_t apr_file_t* parent_err
 

Definition at line 426 of file apr_thread_proc.h.

apr_file_t apr_file_t* parent_in
 

Definition at line 398 of file apr_thread_proc.h.

apr_file_t apr_file_t* parent_out
 

Definition at line 412 of file apr_thread_proc.h.

apr_proc_t* proc
 

Definition at line 723 of file apr_thread_proc.h.

Referenced by apr_netware_proc_cleanup(), ssl_util_ppopen(), and test_pipe_writefull().

const char* progname
 

Definition at line 533 of file apr_thread_proc.h.

int reason
 

Definition at line 679 of file apr_thread_proc.h.

Referenced by cache_save_filter(), check_speling(), dav_validate_resource_state(), and ssl_filter_write().

int sig
 

Definition at line 708 of file apr_thread_proc.h.

Referenced by apr_signal_init().

int status
 

Definition at line 700 of file apr_thread_proc.h.

Referenced by _NonAppStart(), add_redirect_internal(), alloc_listener(), AP_CORE_DECLARE(), AP_DECLARE(), ap_listen_open(), ap_mpm_run(), ap_proxy_http_handler(), ap_proxy_http_process_response(), ap_proxy_http_request(), APR_DECLARE(), apr_file_transfer_contents(), APU_DECLARE(), auth_ldap_post_config(), brigade_consume(), cmd_rewriterule_setflag(), dav_dbm_delete(), dav_dbm_fetch(), dav_dbm_firstkey(), dav_dbm_nextkey(), dav_dbm_open_direct(), dav_dbm_store(), dav_fs_copymove_file(), dav_fs_deleteset(), dav_fs_write_stream(), default_handler(), display_settings(), do_read(), fixup_redir(), ftp_getrc_msg(), get_pw(), groups_for_user(), imap_handler_internal(), index_directory(), initialize_secret(), logio_in_filter(), main(), make_child(), mime_post_config(), nwssl_post_config(), perform_idle_server_maintenance(), prep(), read_connection(), read_type_map(), read_types_multi(), rfc1413_query(), server_main_loop(), ssl_io_filter_input(), ssl_io_filter_output(), ssl_io_input_getline(), start_threads(), test(), test_conversion(), test_dso_sym(), test_dso_sym_library(), test_dso_sym_return_value(), test_dso_sym_return_value_library(), test_load_library(), test_load_module(), test_load_notthere(), test_unload_library(), test_unload_module(), and translate_alias_redir().

int status
 

Definition at line 700 of file apr_thread_proc.h.

int apr_exit_why_e apr_wait_how_e waithow
 

Definition at line 596 of file apr_thread_proc.h.

void(*) void apr_file_t write_fd)
 

Definition at line 633 of file apr_thread_proc.h.