diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-04-14 15:58:54 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-04-14 15:58:54 +0000 |
commit | 00a9ca6dfcb4118e8b5fd850a29512b6350a64e0 (patch) | |
tree | c07dfce5f37b9ffae3b9b7b8b0b435fb98cdc74b /threadproc/os2 | |
parent | cf78e17a5bfa07c2801e0c9005e09496679db918 (diff) | |
download | libapr-00a9ca6dfcb4118e8b5fd850a29512b6350a64e0.tar.gz |
Change ap_context_t to ap_pool_t. This compiles, runs, and serves pages
on Linux, but probably breaks somewhere.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/os2')
-rw-r--r-- | threadproc/os2/proc.c | 8 | ||||
-rw-r--r-- | threadproc/os2/thread.c | 6 | ||||
-rw-r--r-- | threadproc/os2/threadcancel.c | 85 | ||||
-rw-r--r-- | threadproc/os2/threadpriv.c | 2 | ||||
-rw-r--r-- | threadproc/os2/threadproc.h | 10 |
5 files changed, 98 insertions, 13 deletions
diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index c96a42b78..6964d3617 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,7 +71,7 @@ #include <stdlib.h> #include <os2.h> -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont) +ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) { (*new) = (ap_procattr_t *)ap_palloc(cont, sizeof(ap_procattr_t)); @@ -139,7 +139,7 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont) +ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) { int pid; @@ -165,7 +165,7 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(ap_context_t *cntxt, char *str) +static char *double_quotes(ap_pool_t *cntxt, char *str) { int num_quotes = 0; int len = 0; @@ -192,7 +192,7 @@ static char *double_quotes(ap_context_t *cntxt, char *str) ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_context_t *cont) + ap_procattr_t *attr, ap_pool_t *cont) { int i, arg, numargs, cmdlen; ap_status_t status; diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index abf341756..4a7bea7d7 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -61,7 +61,7 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont) +ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { (*new) = (ap_threadattr_t *)ap_palloc(cont, sizeof(ap_threadattr_t)); @@ -101,7 +101,7 @@ static void ap_thread_begin(void *arg) ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, ap_thread_start_t func, void *data, - ap_context_t *cont) + ap_pool_t *cont) { ap_status_t stat; ap_thread_t *thread; @@ -117,7 +117,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, thread->attr = attr; thread->func = func; thread->data = data; - stat = ap_create_context(&thread->cntxt, cont); + stat = ap_create_pool(&thread->cntxt, cont); if (stat != APR_SUCCESS) { return stat; diff --git a/threadproc/os2/threadcancel.c b/threadproc/os2/threadcancel.c new file mode 100644 index 000000000..ca7a18753 --- /dev/null +++ b/threadproc/os2/threadcancel.c @@ -0,0 +1,85 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "threadproc.h" +#include "apr_thread_proc.h" +#include "apr_general.h" +#include "fileio.h" + +ap_status_t ap_cancel_thread(ap_thread_t *thd) +{ + return APR_OS2_STATUS(DosKillThread(thd->tid)); +} + + + +ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) +{ + ULONG rc, nesting; + + if (type == APR_CANCEL_DEFER) + rc = DosEnterMustComplete(&nesting); + else + rc = DosExitMustComplete(&nesting); + + return APR_OS2_STATUS(rc); +} + + + +ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) +{ +/* There's no way to ignore thread kills altogether in OS/2 (that I know of) */ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index a4e009abb..cf436d237 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -60,7 +60,7 @@ #include "fileio.h" ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_context_t *cont) + void (*dest)(void *), ap_pool_t *cont) { (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h index a4f2e3ce4..cfcca8d62 100644 --- a/threadproc/os2/threadproc.h +++ b/threadproc/os2/threadproc.h @@ -64,12 +64,12 @@ #define APR_THREAD_STACKSIZE 65536 struct ap_threadattr_t { - ap_context_t *cntxt; + ap_pool_t *cntxt; unsigned long attr; }; struct ap_thread_t { - ap_context_t *cntxt; + ap_pool_t *cntxt; struct ap_threadattr_t *attr; unsigned long tid; ap_thread_start_t func; @@ -78,12 +78,12 @@ struct ap_thread_t { }; struct ap_threadkey_t { - ap_context_t *cntxt; + ap_pool_t *cntxt; unsigned long *key; }; struct ap_procattr_t { - ap_context_t *cntxt; + ap_pool_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; ap_file_t *parent_out; @@ -96,7 +96,7 @@ struct ap_procattr_t { }; struct ap_proc_t { - ap_context_t *cntxt; + ap_pool_t *cntxt; pid_t pid; struct ap_procattr_t *attr; int running; |