⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apr_thread_proc.h

📁 apache的软件linux版本
💻 H
📖 第 1 页 / 共 3 页
字号:
#if APR_HAS_FORK/** * This is currently the only non-portable call in APR.  This executes  * a standard unix fork. * @param proc The resulting process handle.  * @param cont The pool to use.  */APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont);#endif/** * Create a new process and execute a new program within that process. * @param new_proc The resulting process handle. * @param progname The program to run  * @param args the arguments to pass to the new program.  The first  *             one should be the program name. * @param env The new environment table for the new process.  This  *            should be a list of NULL-terminated strings. This argument *            is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and *            APR_SHELLCMD_ENV types of commands. * @param attr the procattr we should use to determine how to create the new *         process * @param cont The pool to use.  */APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc,                                             const char *progname,                                             const char * const *args,                                             const char * const *env,                                              apr_procattr_t *attr,                                              apr_pool_t *cont);/** * Wait for a child process to die * @param proc The process handle that corresponds to the desired child process  * @param exitcode The returned exit status of the child, if a child process  *                 dies, or the signal that caused the child to die. *                 On platforms that don't support obtaining this information,  *                 the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: * <PRE> *            APR_PROC_EXIT         -- process terminated normally *            APR_PROC_SIGNAL       -- process was killed by a signal *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and *                                     generated a core dump. * </PRE> * @param waithow How should we wait.  One of: * <PRE> *            APR_WAIT   -- block until the child process dies. *            APR_NOWAIT -- return immediately regardless of if the  *                          child is dead or not. * </PRE> * @remark The childs status is in the return code to this process.  It is one of: * <PRE> *            APR_CHILD_DONE     -- child is no longer running. *            APR_CHILD_NOTDONE  -- child is still running. * </PRE> */APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,                                        int *exitcode, apr_exit_why_e *exitwhy,                                        apr_wait_how_e waithow);/** * Wait for any current child process to die and return information  * about that child. * @param proc Pointer to NULL on entry, will be filled out with child's  *             information  * @param exitcode The returned exit status of the child, if a child process  *                 dies, or the signal that caused the child to die. *                 On platforms that don't support obtaining this information,  *                 the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: * <PRE> *            APR_PROC_EXIT         -- process terminated normally *            APR_PROC_SIGNAL       -- process was killed by a signal *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and *                                     generated a core dump. * </PRE> * @param waithow How should we wait.  One of: * <PRE> *            APR_WAIT   -- block until the child process dies. *            APR_NOWAIT -- return immediately regardless of if the  *                          child is dead or not. * </PRE> * @param p Pool to allocate child information out of. * @bug Passing proc as a *proc rather than **proc was an odd choice * for some platforms... this should be revisited in 1.0 */APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,                                                  int *exitcode,                                                  apr_exit_why_e *exitwhy,                                                  apr_wait_how_e waithow,                                                  apr_pool_t *p);#define APR_PROC_DETACH_FOREGROUND 0    /**< Do not detach */#define APR_PROC_DETACH_DAEMONIZE 1     /**< Detach *//** * Detach the process from the controlling terminal. * @param daemonize set to non-zero if the process should daemonize *                  and become a background process, else it will *                  stay in the foreground. */APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize);/** * Register an other_child -- a child associated to its registered  * maintence callback.  This callback is invoked when the process * dies, is disconnected or disappears. * @param proc The child process to register. * @param maintenance maintenance is a function that is invoked with a  *                    reason and the data pointer passed here. * @param data Opaque context data passed to the maintenance function. * @param write_fd An fd that is probed for writing.  If it is ever unwritable *                 then the maintenance is invoked with reason  *                 OC_REASON_UNWRITABLE. * @param 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. * @bug no platform currently tests the pipes health. */APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc,                                            void (*maintenance) (int reason,                                                                 void *,                                                                 int status),                                           void *data, apr_file_t *write_fd,                                           apr_pool_t *p);/** * Stop watching the specified other child.   * @param data The data to pass to the maintenance function.  This is *             used to find the process to unregister. * @warning Since this can be called by a maintenance function while we're *          scanning the other_children list, all scanners should protect  *          themself by loading ocr->next before calling any maintenance  *          function. */APR_DECLARE(void) apr_proc_other_child_unregister(void *data);/** * Notify the maintenance callback of a registered other child process * that application has detected an event, such as death. * @param proc The process to check * @param reason The reason code to pass to the maintenance function * @param status The status to pass to the maintenance function * @remark An example of code using this behavior; * <pre> * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p); * if (APR_STATUS_IS_CHILD_DONE(rv)) { * #if APR_HAS_OTHER_CHILD *     if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status) *             == APR_SUCCESS) { *         ;  (already handled) *     } *     else * #endif *         [... handling non-otherchild processes death ...] * </pre> */APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc,                                                      int reason,                                                     int status);/** * Test one specific other child processes and invoke the maintenance callback  * with the appropriate reason code, if still running, or the appropriate reason  * code if the process is no longer healthy. * @param ocr The registered other child * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running */APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr,                                               int reason);/** * Test all registered other child processes and invoke the maintenance callback  * with the appropriate reason code, if still running, or the appropriate reason  * code if the process is no longer healthy. * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes */APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason);/** @deprecated @see apr_proc_other_child_refresh_all * @remark Call apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART) * or apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING) instead. * @bug The differing implementations of this function on Win32 (_RUNNING checks)  * and Unix (used only for _RESTART) are the reason it will be dropped with APR 1.0. */APR_DECLARE(void) apr_proc_other_child_check(void);/** @deprecated @see apr_proc_other_child_alert * @bug This function's name had nothing to do with it's purpose */APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status);/**  * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. */APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig);/** * Register a process to be killed when a pool dies. * @param a The pool to use to define the processes lifetime  * @param proc The process to register * @param how How to kill the process, one of: * <PRE> *         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 * </PRE> */APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc,                                           apr_kill_conditions_e how);#if APR_HAS_THREADS #if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2)/** * Setup the process for a single thread to be used for all signal handling. * @warning This must be called before any threads are created */APR_DECLARE(apr_status_t) apr_setup_signal_thread(void);/** * Make the current thread listen for signals.  This thread will loop * forever, calling a provided function whenever it receives a signal.  That * functions should return 1 if the signal has been handled, 0 otherwise. * @param signal_handler The function to call when a signal is received * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) */APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum));#endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) *//** * Get the child-pool used by the thread from the thread info. * @return apr_pool_t the pool */APR_POOL_DECLARE_ACCESSOR(thread);#endif /* APR_HAS_THREADS *//** @} */#ifdef __cplusplus}#endif#endif  /* ! APR_THREAD_PROC_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -