[rtems commit] score: Fix _Thread_Initialize()
Sebastian Huber
sebh at rtems.org
Tue Jan 31 09:11:01 UTC 2017
Module: rtems
Branch: master
Commit: 70488f5655079bcbf19f55999adbbc51a30f46ad
Changeset: http://git.rtems.org/rtems/commit/?id=70488f5655079bcbf19f55999adbbc51a30f46ad
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jan 31 09:37:54 2017 +0100
score: Fix _Thread_Initialize()
---
cpukit/score/include/rtems/score/thread.h | 3 +++
cpukit/score/src/threadinitialize.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index c114c91..8aa141d 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -690,6 +690,9 @@ typedef struct {
*
* Uses a leading underscore in the structure name to allow forward
* declarations in standard header files provided by Newlib and GCC.
+ *
+ * In case the second member changes (currently Join_queue), then the memset()
+ * in _Thread_Initialize() must be adjusted.
*/
struct _Thread_Control {
/** This field is the object management structure for each thread. */
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 5725c6e..60bbd22 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -72,9 +72,9 @@ bool _Thread_Initialize(
#endif
memset(
- &the_thread->current_state,
+ &the_thread->Join_queue,
0,
- information->Objects.size - offsetof( Thread_Control, current_state )
+ information->Objects.size - offsetof( Thread_Control, Join_queue )
);
for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) {
More information about the vc
mailing list