trawick 02/03/14 14:18:17
Modified: . CHANGES
include apr_thread_proc.h
memory/unix apr_pools.c
Log:
Move the kill_conditions enum in apr_thread_proc.h into the
APR namespace. kill_after_timeout et al have been renamed
appropriately (e.g., APR_KILL_AFTER_TIMEOUT).
Jon Travis pointed this out some weeks ago on [EMAIL PROTECTED]
Revision Changes Path
1.240 +4 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -r1.239 -r1.240
--- CHANGES 12 Mar 2002 23:40:10 -0000 1.239
+++ CHANGES 14 Mar 2002 22:18:16 -0000 1.240
@@ -1,5 +1,9 @@
Changes with APR b1
+ *) Move the kill_conditions enum in apr_thread_proc.h into the
+ APR namespace. kill_after_timeout et al have been renamed
+ appropriately (e.g., APR_KILL_AFTER_TIMEOUT). [Jeff Trawick]
+
*) Fix a segfault in apr_thread_rwlock_destroy() on Win32.
[INOUE Seiichiro <[EMAIL PROTECTED]>]
1.84 +13 -13 apr/include/apr_thread_proc.h
Index: apr_thread_proc.h
===================================================================
RCS file: /home/cvs/apr/include/apr_thread_proc.h,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- apr_thread_proc.h 14 Mar 2002 21:42:07 -0000 1.83
+++ apr_thread_proc.h 14 Mar 2002 22:18:16 -0000 1.84
@@ -183,13 +183,13 @@
*/
typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*);
-enum kill_conditions {
- kill_never, /**< process is never sent any signals */
- kill_always, /**< process is sent SIGKILL on apr_pool_t
cleanup */
- kill_after_timeout, /**< SIGTERM, wait 3 seconds, SIGKILL */
- just_wait, /**< wait forever for the process to
complete */
- kill_only_once /**< send SIGTERM and then wait */
-};
+typedef enum {
+ 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 */
+} apr_kill_conditions_e;
/* Thread Function definitions */
@@ -634,15 +634,15 @@
* @param pid The process to register
* @param how How to kill the process, one of:
* <PRE>
- * kill_never -- process is never sent any signals
- * kill_always -- process is sent SIGKILL on apr_pool_t
cleanup
- * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
- * just_wait -- wait forever for the process to complete
- * kill_only_once -- send SIGTERM and then wait
+ * 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 *pid,
- enum kill_conditions how);
+ apr_kill_conditions_e how);
#if APR_HAS_THREADS
1.158 +8 -15 apr/memory/unix/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -r1.157 -r1.158
--- apr_pools.c 14 Mar 2002 21:42:07 -0000 1.157
+++ apr_pools.c 14 Mar 2002 22:18:16 -0000 1.158
@@ -109,14 +109,7 @@
struct process_chain {
/** The process ID */
apr_proc_t *pid;
- /** When the process should be sent a signal. <PRE>
- * kill_never -- process is never sent any signals
- * kill_always -- process is sent SIGKILL on apr_pool_t
cleanup
- * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
- * just_wait -- wait forever for the process to complete
- * kill_only_once -- send SIGTERM and then wait </PRE>
- */
- enum kill_conditions kill_how;
+ apr_kill_conditions_e kill_how;
/** The next process in the list */
struct process_chain *next;
};
@@ -1718,7 +1711,7 @@
* For now, it's a special case.
*/
APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid,
- enum kill_conditions how)
+ apr_kill_conditions_e how)
{
struct process_chain *pc = apr_palloc(pool, sizeof(struct
process_chain));
@@ -1751,13 +1744,13 @@
/* Pick up all defunct processes */
for (pc = procs; pc; pc = pc->next) {
if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) !=
APR_CHILD_NOTDONE)
- pc->kill_how = kill_never;
+ pc->kill_how = APR_KILL_NEVER;
}
#endif /* !defined(NEED_WAITPID) */
for (pc = procs; pc; pc = pc->next) {
- if ((pc->kill_how == kill_after_timeout) ||
- (pc->kill_how == kill_only_once)) {
+ if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) ||
+ (pc->kill_how == APR_KILL_ONLY_ONCE)) {
/*
* Subprocess may be dead already. Only need the timeout if not.
* Note: apr_proc_kill on Windows is TerminateProcess(), which is
@@ -1771,7 +1764,7 @@
need_timeout = 1;
#endif /* !defined(WIN32) */
}
- else if (pc->kill_how == kill_always) {
+ else if (pc->kill_how == APR_KILL_ALWAYS) {
apr_proc_kill(pc->pid, SIGKILL);
}
}
@@ -1785,13 +1778,13 @@
* goop...
*/
for (pc = procs; pc; pc = pc->next) {
- if (pc->kill_how == kill_after_timeout)
+ if (pc->kill_how == APR_KILL_AFTER_TIMEOUT)
apr_proc_kill(pc->pid, SIGKILL);
}
/* Now wait for all the signaled processes to die */
for (pc = procs; pc; pc = pc->next) {
- if (pc->kill_how != kill_never)
+ if (pc->kill_how != APR_KILL_NEVER)
(void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT);
}