00001 /* 00002 * Copyright 1999-2006 University of Chicago 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 00022 #ifndef GLOBUS_THREAD_RMUTEX_H 00023 #define GLOBUS_THREAD_RMUTEX_H 00024 00025 #include "globus_common_include.h" 00026 #include "globus_thread.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00038 typedef struct 00039 { 00040 globus_mutex_t mutex; 00041 globus_cond_t cond; 00042 globus_thread_t thread_id; 00043 int level; 00044 int waiting; 00045 } globus_rmutex_t; 00046 00051 typedef int globus_rmutexattr_t; 00052 00053 int 00054 globus_rmutex_init( 00055 globus_rmutex_t * rmutex, 00056 globus_rmutexattr_t * attr); 00057 00058 int 00059 globus_rmutex_lock( 00060 globus_rmutex_t * rmutex); 00061 00062 int 00063 globus_rmutex_unlock( 00064 globus_rmutex_t * rmutex); 00065 00066 int 00067 globus_rmutex_destroy( 00068 globus_rmutex_t * rmutex); 00069 00070 00071 #ifdef __cplusplus 00072 } 00073 #endif 00074 #endif /* GLOBUS_THREAD_RMUTEX_H */