aboutsummaryrefslogtreecommitdiffstats
path: root/demos/Win32-MinGW/chconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'demos/Win32-MinGW/chconf.h')
-rw-r--r--demos/Win32-MinGW/chconf.h6
1 files changed, 6 insertions, 0 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_ */
/** @} */