GME  13
apr_arch_threadproc.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "apr_thread_proc.h"
00018 #include "apr_arch_file_io.h"
00019 #include "apr_file_io.h"
00020 #include "apr_thread_proc.h"
00021 #include "apr_general.h"
00022 #include "apr_portable.h"
00023 #include <kernel/OS.h>
00024 #include <signal.h>
00025 #include <string.h>
00026 #include <sys/wait.h>
00027 #include <image.h>
00028 
00029 #ifndef THREAD_PROC_H
00030 #define THREAD_PROC_H
00031 
00032 #define SHELL_PATH "/bin/sh"
00033 
00034 #define PTHREAD_CANCEL_AYNCHRONOUS  CANCEL_ASYNCH; 
00035 #define PTHREAD_CANCEL_DEFERRED     CANCEL_DEFER; 
00036                                    
00037 #define PTHREAD_CANCEL_ENABLE       CANCEL_ENABLE; 
00038 #define PTHREAD_CANCEL_DISABLE      CANCEL_DISABLE; 
00039 
00040 #define BEOS_MAX_DATAKEYS       128
00041 
00042 struct apr_thread_t {
00043     apr_pool_t *pool;
00044     thread_id td;
00045     void *data;
00046     apr_thread_start_t func;
00047     apr_status_t exitval;
00048 };
00049 
00050 struct apr_threadattr_t {
00051     apr_pool_t *pool;
00052     int32 attr;
00053     int detached;
00054     int joinable;
00055 };
00056 
00057 struct apr_threadkey_t {
00058     apr_pool_t *pool;
00059         int32  key;
00060 };
00061 
00062 struct beos_private_data {
00063         const void ** data;
00064         int count;
00065         volatile thread_id  td;
00066 };
00067 
00068 struct beos_key {
00069         int  assigned;
00070         int  count;
00071         sem_id  lock;
00072         int32  ben_lock;
00073         void (* destructor) (void *);
00074 };
00075 
00076 struct apr_procattr_t {
00077     apr_pool_t *pool;
00078     apr_file_t *parent_in;
00079     apr_file_t *child_in;
00080     apr_file_t *parent_out;
00081     apr_file_t *child_out;
00082     apr_file_t *parent_err;
00083     apr_file_t *child_err;
00084     char *currdir;
00085     apr_int32_t cmdtype;
00086     apr_int32_t detached;
00087 };
00088 
00089 struct apr_thread_once_t {
00090     sem_id sem;
00091     int hit;
00092 };
00093 
00094 #endif  /* ! THREAD_PROC_H */
00095