From c9205e2fd961c60cffd1000936340806a8e45558 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 24 Sep 2008 12:28:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@442 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/include/threads.h | 5 ++++- src/lib/ch.cpp | 4 ++-- src/lib/ch.hpp | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/include/threads.h b/src/include/threads.h index 822a9ab69..b2c7bfb1b 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -177,10 +177,14 @@ extern "C" { tprio_t prio, tfunc_t pf, void *arg); Thread *chThdCreateStatic(void *workspace, size_t wsize, tprio_t prio, tfunc_t pf, void *arg); +#if defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_HEAP) Thread *chThdCreateFromHeap(size_t wsize, tprio_t prio, tfunc_t pf, void *arg); +#endif +#if defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_MEMPOOLS) Thread *chThdCreateFromMemoryPool(MemoryPool *mp, tprio_t prio, tfunc_t pf, void *arg); +#endif Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace, size_t wsize, tfunc_t pf, void *arg); Thread *chThdCreateFast(tprio_t prio, void *workspace, @@ -218,7 +222,6 @@ extern "C" { * Returns the exit event source for the specified thread. The source is * signaled when the thread terminates. * @param tp the pointer to the thread - * @deprecated * @note When registering on a thread termination make sure the thread * is still alive, if you do that after the thread termination * then you would miss the event. There are two ways to ensure diff --git a/src/lib/ch.cpp b/src/lib/ch.cpp index 170a143a7..1d63cefd5 100644 --- a/src/lib/ch.cpp +++ b/src/lib/ch.cpp @@ -74,9 +74,9 @@ namespace chibios_rt { return ((BaseThread *)arg)->Main(); } - BaseThread::BaseThread(tprio_t prio, tmode_t mode, void *workspace, size_t wsize) { + BaseThread::BaseThread(void *workspace, size_t wsize, tprio_t prio) { - thread_ref = chThdCreate(prio, mode, workspace, wsize, thdstart, this); + thread_ref = chThdCreateStatic(workspace, wsize, prio, thdstart, this); } void BaseThread::Exit(msg_t msg) { diff --git a/src/lib/ch.hpp b/src/lib/ch.hpp index f041365d7..79e40e32b 100644 --- a/src/lib/ch.hpp +++ b/src/lib/ch.hpp @@ -101,7 +101,7 @@ namespace chibios_rt { /** * Thread constructor. */ - BaseThread(tprio_t prio, tmode_t mode, void *workspace, size_t wsize); + BaseThread(void *workspace, size_t wsize, tprio_t prio); /** * Thread exit. @@ -196,8 +196,8 @@ namespace chibios_rt { * Full constructor. It allows to set a priority level for the new thread * and specify the special option flags. */ - EnhancedThread(const char *tname, tprio_t prio, tmode_t mode) : - BaseThread(prio, mode, wa, sizeof wa) { + EnhancedThread(const char *tname, tprio_t prio) : + BaseThread(wa, sizeof wa, prio) { name = tname; } @@ -208,7 +208,7 @@ namespace chibios_rt { * and no special option flags. */ EnhancedThread(const char *tname) : - BaseThread(NORMALPRIO, 0, wa, sizeof wa) { + BaseThread(wa, sizeof wa, NORMALPRIO) { name = tname; } -- cgit v1.2.3