00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as 00002 * applicable. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * 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 #ifndef APR_THREAD_MUTEX_H 00018 #define APR_THREAD_MUTEX_H 00019 00025 #include "apr.h" 00026 #include "apr_errno.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif /* __cplusplus */ 00031 00032 #if APR_HAS_THREADS || defined(DOXYGEN) 00033 00041 typedef struct apr_thread_mutex_t apr_thread_mutex_t; 00042 00043 #define APR_THREAD_MUTEX_DEFAULT 0x0 00044 #define APR_THREAD_MUTEX_NESTED 0x1 00045 #define APR_THREAD_MUTEX_UNNESTED 0x2 00047 /* Delayed the include to avoid a circular reference */ 00048 #include "apr_pools.h" 00049 00065 APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, 00066 unsigned int flags, 00067 apr_pool_t *pool); 00073 APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); 00074 00082 APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); 00083 00088 APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); 00089 00094 APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); 00095 00100 APR_POOL_DECLARE_ACCESSOR(thread_mutex); 00101 00102 #endif /* APR_HAS_THREADS */ 00103 00106 #ifdef __cplusplus 00107 } 00108 #endif 00109 00110 #endif /* ! APR_THREAD_MUTEX_H */