00001 /* 00002 * This file is part of liberregxml. 00003 * 00004 * liberregxml is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * liberregxml is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00030 #ifndef _ERREG_RWLOCK_H_ 00031 #define _ERREG_RWLOCK_H_ 00032 00033 #include <glib.h> 00034 00035 #ifdef __cplusplus 00036 extern "C" 00037 { 00038 #endif 00039 00040 00041 typedef enum 00042 { 00043 lock_none, 00044 lock_read, 00045 lock_write 00046 } lock_state_t; 00047 00053 gboolean erRegRWLockInit(void); 00054 00059 void erRegRWLockDestroy(void); 00060 00066 gboolean erRegReadLock(void); 00067 00073 gboolean erRegWriteLock(void); 00074 00079 gboolean erRegUnlock(void); 00080 00085 lock_state_t erRegGetLockState(void); 00086 00087 00088 #ifdef __cplusplus 00089 } 00090 #endif 00091 00092 #endif //_ERREG_RWLOCK_H_