00001 /*************************************************************************** 00002 tag: 00003 00004 ecos_rec_mutex.h - description 00005 ------------------- 00006 begin : Jan 21 2006 00007 copyright : (C) 2006 Klaas Gadeyne 00008 email : firstname lastname at fmtc be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, * 00024 * Suite 330, Boston, MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 00029 #ifndef ORO_OS_ECOS_REC_MUTEX_HPP 00030 #define ORO_OS_ECOS_REC_MUTEX_HPP 00031 00032 #include <cyg/kernel/kapi.h> 00033 00034 #ifdef __cplusplus 00035 extern "C" 00036 { 00037 #endif 00038 00039 typedef struct 00040 { 00041 cyg_mutex_t mutex; 00042 cyg_handle_t owner; 00043 cyg_uint32 count; 00044 } 00045 cyg_recursive_mutex_t; 00046 00048 void cyg_recursive_mutex_init( cyg_recursive_mutex_t *mx ); 00049 00051 bool cyg_recursive_mutex_lock( cyg_recursive_mutex_t *mx ); 00052 00054 bool cyg_recursive_mutex_trylock( cyg_recursive_mutex_t *mx ); 00055 00057 void cyg_recursive_mutex_unlock( cyg_recursive_mutex_t *mx ); 00058 00060 void cyg_recursive_mutex_destroy( cyg_recursive_mutex_t *mx ); 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif // __cplusplus 00065 00066 #endif