libcsupport: Use _Thread_Get_executing()

This commit is contained in:
Sebastian Huber
2013-07-22 16:46:00 +02:00
parent d7ce33f17e
commit d566f33e67
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -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;
+4 -3
View File
@@ -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;
}
}