[rtems commit] libcsupport: Use _Thread_Get_executing()

Sebastian Huber sebh at rtems.org
Mon Jul 22 14:51:42 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul 19 17:16:58 2013 +0200

libcsupport: Use _Thread_Get_executing()

---

 cpukit/libcsupport/src/__times.c |    4 ++--
 cpukit/libcsupport/src/sync.c    |    7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c
index d941f93..71eb4e2 100644
--- a/cpukit/libcsupport/src/__times.c
+++ b/cpukit/libcsupport/src/__times.c
@@ -70,7 +70,7 @@ clock_t _times(
       );
 
       _Timestamp_Divide(
-        &_Thread_Executing->cpu_time_used,
+        &_Thread_Get_executing()->cpu_time_used,
         &per_tick,
         &ticks,
         &fractional_ticks
@@ -78,7 +78,7 @@ clock_t _times(
       ptms->tms_utime = ticks;
     }
   #else
-    ptms->tms_utime  = _Thread_Executing->cpu_time_used;
+    ptms->tms_utime  = _Thread_Get_executing()->cpu_time_used;
   #endif
   ptms->tms_stime  = ticks;
   ptms->tms_cutime = 0;
diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c
index 2e83867..6cb6a28 100644
--- a/cpukit/libcsupport/src/sync.c
+++ b/cpukit/libcsupport/src/sync.c
@@ -65,10 +65,11 @@ static void sync_per_thread(Thread_Control *t)
     */
    this_reent = t->libc_reent;
    if ( this_reent ) {
-     current_reent = _Thread_Executing->libc_reent;
-     _Thread_Executing->libc_reent = this_reent;
+     Thread_Control *executing = _Thread_Get_executing();
+     current_reent = executing->libc_reent;
+     executing->libc_reent = this_reent;
      _fwalk (t->libc_reent, sync_wrapper);
-     _Thread_Executing->libc_reent = current_reent;
+     executing->libc_reent = current_reent;
    }
 }
 




More information about the vc mailing list