mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-21 01:28:28 +08:00
libcsupport: Use _Thread_Get_executing()
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user