Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

apr_proc_mutex.h

Go to the documentation of this file.
00001 /* Copyright 2000-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef APR_PROC_MUTEX_H
00017 #define APR_PROC_MUTEX_H
00018 
00024 #include "apr.h"
00025 #include "apr_pools.h"
00026 #include "apr_errno.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif /* __cplusplus */
00031 
00043 typedef enum {
00044     APR_LOCK_FCNTL,         
00045     APR_LOCK_FLOCK,         
00046     APR_LOCK_SYSVSEM,       
00047     APR_LOCK_PROC_PTHREAD,  
00048     APR_LOCK_POSIXSEM,      
00049     APR_LOCK_DEFAULT        
00050 } apr_lockmech_e;
00051 
00053 typedef struct apr_proc_mutex_t apr_proc_mutex_t;
00054 
00055 /*   Function definitions */
00056 
00078 APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
00079                                                 const char *fname,
00080                                                 apr_lockmech_e mech,
00081                                                 apr_pool_t *pool);
00082 
00094 APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
00095                                                     const char *fname,
00096                                                     apr_pool_t *pool);
00097 
00103 APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex);
00104 
00112 APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex);
00113 
00118 APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex);
00119 
00124 APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex);
00125 
00132 APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex);
00133 
00139 APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex);
00140 
00146 APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex);
00147 
00151 APR_DECLARE(const char *) apr_proc_mutex_defname(void);
00152 
00157 APR_POOL_DECLARE_ACCESSOR(proc_mutex);
00158 
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164 
00165 #endif  /* ! APR_PROC_MUTEX_H */

Generated on Fri Sep 17 11:18:21 2004 for Apache Portable Runtime by doxygen 1.3.5