diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-12-29 08:58:17 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-12-29 08:58:17 +0000 |
commit | 5300fced15f40774f8fcf75904373541ea351efa (patch) | |
tree | b827e1e605bfed623163bf18d64ab08d0e1bd5c6 | |
parent | b1e4025ebd651cc922e3fcfb0706a7b8c7cabeba (diff) | |
download | ChibiOS-5300fced15f40774f8fcf75904373541ea351efa.tar.gz ChibiOS-5300fced15f40774f8fcf75904373541ea351efa.tar.bz2 ChibiOS-5300fced15f40774f8fcf75904373541ea351efa.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@553 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | demos/Win32-MinGW/chconf.h | 6 | ||||
-rw-r--r-- | demos/Win32-MinGW/chcore.h | 10 | ||||
-rw-r--r-- | readme.txt | 6 | ||||
-rw-r--r-- | src/include/threads.h | 3 |
4 files changed, 16 insertions, 9 deletions
diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index 3187998cc..5b487dbe7 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -172,20 +172,26 @@ #define THREAD_EXT_FIELDS \
struct { \
/* Add thread custom fields here.*/ \
+ /* The thread termination \p EventSource.*/ \
+ EventSource p_exitesource; \
};
/** User initialization code added to the \p chThdCreate() API.
* @note It is invoked from within \p chThdInit(). */
#define THREAD_EXT_INIT(tp) { \
/* Add thread initialization code here.*/ \
+ chEvtInit(&tp->p_exitesource); \
}
/** User finalization code added to the \p chThdExit() API.
* @note It is inserted into lock zone. */
#define THREAD_EXT_EXIT(tp) { \
/* Add thread finalization code here.*/ \
+ chEvtBroadcastI(&currp->p_exitesource); \
}
+#define chThdGetExitEventSource(tp) (&(tp)->p_exitesource)
+
#endif /* _CHCONF_H_ */
/** @} */
diff --git a/demos/Win32-MinGW/chcore.h b/demos/Win32-MinGW/chcore.h index 9c7f9e8c1..d1f209a68 100644 --- a/demos/Win32-MinGW/chcore.h +++ b/demos/Win32-MinGW/chcore.h @@ -78,11 +78,11 @@ typedef struct { #define STACK_ALIGN(n) ((((n) - 1) | sizeof(stkalign_t)) + 1)
-#define THD_WA_SIZE(n) StackAlign(sizeof(Thread) + \
- sizeof(void *) * 2 + \
- sizeof(struct intctx) + \
- (n) + \
- INT_REQUIRED_STACK)
+#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
+ sizeof(void *) * 2 + \
+ sizeof(struct intctx) + \
+ (n) + \
+ INT_REQUIRED_STACK)
#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
diff --git a/readme.txt b/readme.txt index 0384de8b5..40c451676 100644 --- a/readme.txt +++ b/readme.txt @@ -76,8 +76,10 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, *** 1.0.0 RC1 ***
- FIX: Disabled the configuration option CH_USE_MESSAGES_PRIORITY from the
MSP430 demo, the default for this option should be off.
-- Removed deprecated threads APIs: chThdCreate() and chThdCreateFast(), removed
- some references to those APIs from the test suite.
+- FIX: Fixed a bug that prevented the THREAD_EXT_FIELDS to be compiled into
+ the Thread structure.
+- FIX: Removed some references to dečrecated APIs from the test suite.
+- Removed deprecated threads APIs: chThdCreate() and chThdCreateFast().
- Removed deprecated events APIs: chEvtWait(), chEvtWaitTimeout(), chEvtSend(),
chEvtSendI(), EventMask().
- Removed deprecated configuration feature CH_USE_EXIT_EVENT and the related
diff --git a/src/include/threads.h b/src/include/threads.h index 4681a9caa..b537d6bc6 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -112,9 +112,8 @@ struct Thread { /** Memory Pool where the thread workspace is returned. */ void *p_mpool; #endif -#ifdef CH_USE_THREAD_EXT + /* Extra fields defined in chconf.h */ THREAD_EXT_FIELDS -#endif }; /** Thread state: Ready to run, waiting on the ready list.*/ |