ChibiOS/RT
2.5.1
chdynamic.h
Go to the documentation of this file.
00001 /*
00002     ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
00003                  2011,2012 Giovanni Di Sirio.
00004 
00005     This file is part of ChibiOS/RT.
00006 
00007     ChibiOS/RT is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     ChibiOS/RT is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 /**
00022  * @file    chdynamic.h
00023  * @brief   Dynamic threads macros and structures.
00024  *
00025  * @addtogroup dynamic_threads
00026  * @{
00027  */
00028 
00029 #ifndef _CHDYNAMIC_H_
00030 #define _CHDYNAMIC_H_
00031 
00032 #if CH_USE_DYNAMIC || defined(__DOXYGEN__)
00033 
00034 /*
00035  * Module dependencies check.
00036  */
00037 #if CH_USE_DYNAMIC && !CH_USE_WAITEXIT
00038 #error "CH_USE_DYNAMIC requires CH_USE_WAITEXIT"
00039 #endif
00040 #if CH_USE_DYNAMIC && !CH_USE_HEAP && !CH_USE_MEMPOOLS
00041 #error "CH_USE_DYNAMIC requires CH_USE_HEAP and/or CH_USE_MEMPOOLS"
00042 #endif
00043 
00044 /*
00045  * Dynamic threads APIs.
00046  */
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050   Thread *chThdAddRef(Thread *tp);
00051   void chThdRelease(Thread *tp);
00052 #if CH_USE_HEAP
00053   Thread *chThdCreateFromHeap(MemoryHeap *heapp, size_t size,
00054                               tprio_t prio, tfunc_t pf, void *arg);
00055 #endif
00056 #if CH_USE_MEMPOOLS
00057   Thread *chThdCreateFromMemoryPool(MemoryPool *mp, tprio_t prio,
00058                                     tfunc_t pf, void *arg);
00059 #endif
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 
00064 #endif /* CH_USE_DYNAMIC */
00065 
00066 #endif /* _CHDYNAMIC_H_ */
00067 
00068 /** @} */