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_THREAD_MUTEX_H 00017 #define APR_THREAD_MUTEX_H 00018 00024 #include "apr.h" 00025 #include "apr_errno.h" 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif /* __cplusplus */ 00030 00031 #if APR_HAS_THREADS || defined(DOXYGEN) 00032 00040 typedef struct apr_thread_mutex_t apr_thread_mutex_t; 00041 00042 #define APR_THREAD_MUTEX_DEFAULT 0x0 00043 #define APR_THREAD_MUTEX_NESTED 0x1 00044 #define APR_THREAD_MUTEX_UNNESTED 0x2 00046 /* Delayed the include to avoid a circular reference */ 00047 #include "apr_pools.h" 00048 00064 APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, 00065 unsigned int flags, 00066 apr_pool_t *pool); 00072 APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); 00073 00081 APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); 00082 00087 APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); 00088 00093 APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); 00094 00099 APR_POOL_DECLARE_ACCESSOR(thread_mutex); 00100 00101 #endif /* APR_HAS_THREADS */ 00102 00105 #ifdef __cplusplus 00106 } 00107 #endif 00108 00109 #endif /* ! APR_THREAD_MUTEX_H */