[rtems commit] posix: Move POSIX_API_Control::thread

Sebastian Huber sebh at rtems.org
Wed Oct 18 06:52:12 UTC 2017


Module:    rtems
Branch:    master
Commit:    2be22d4f6478e80cd7df05b888650d1563d2b504
Changeset: http://git.rtems.org/rtems/commit/?id=2be22d4f6478e80cd7df05b888650d1563d2b504

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Oct 17 08:38:47 2017 +0200

posix: Move POSIX_API_Control::thread

This member is only used by the sporadic server support.

Update #2514.

---

 cpukit/posix/include/rtems/posix/threadsup.h | 6 +++---
 cpukit/posix/src/pthread.c                   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h
index cc250f7..816ef56 100644
--- a/cpukit/posix/include/rtems/posix/threadsup.h
+++ b/cpukit/posix/include/rtems/posix/threadsup.h
@@ -40,9 +40,6 @@ extern "C" {
  * each thread in a system with POSIX configured.
  */
 typedef struct {
-  /** Back pointer to thread of this POSIX API control. */
-  Thread_Control         *thread;
-
   /** Created with explicit or inherited scheduler. */
   bool created_with_explicit_scheduler;
 
@@ -56,6 +53,9 @@ typedef struct {
    * @brief Control block for the sporadic server scheduling policy.
    */
   struct {
+    /** The thread of this sporadic control block */
+    Thread_Control *thread;
+
     /**
      * @brief This is the timer which controls when the thread executes at high
      * and low priority when using the sporadic server scheduling policy.
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 9d1c1ad..291b195 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -49,7 +49,7 @@ void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
   Thread_queue_Context  queue_context;
 
   api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
-  the_thread = api->thread;
+  the_thread = api->Sporadic.thread;
 
   _Thread_queue_Context_initialize( &queue_context );
   _Thread_queue_Context_clear_priority_updates( &queue_context );
@@ -127,7 +127,6 @@ static bool _POSIX_Threads_Create_extension(
   api = created->API_Extensions[ THREAD_API_POSIX ];
 
   /* XXX check all fields are touched */
-  api->thread = created;
   api->schedparam.sched_priority = _POSIX_Priority_From_core(
     _Thread_Scheduler_get_home( created ),
     _Thread_Get_priority( created )
@@ -149,6 +148,7 @@ static bool _POSIX_Threads_Create_extension(
     api->signals_unblocked = executing_api->signals_unblocked;
   }
 
+  api->Sporadic.thread = created;
   _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
   _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
   _Priority_Node_set_inactive( &api->Sporadic.Low_priority );




More information about the vc mailing list