Mercurial > ecos
diff packages/kernel/current/src/common/thread.cxx @ 2117:5d7f57fd1729
* src/sched/sched.cxx:
* include/sched.hxx (class Cyg_Scheduler): Added thread_entry()
member function. This handles thread startup housekeeping. Zeroing
the scheduler lock is handled by calling unlock() so that DSRs may
be run.
* src/common/thread.cxx (thread_entry): Refactored code to call
Cyg_Scheduler::thread_entry() instead of doing all the work here.
| author | nickg |
|---|---|
| date | Tue, 10 Jan 2006 15:52:54 +0000 |
| parents | 7002f6e48db9 |
| children | 1406c9fadbf3 |
line wrap: on
line diff
--- a/packages/kernel/current/src/common/thread.cxx +++ b/packages/kernel/current/src/common/thread.cxx @@ -86,24 +86,10 @@ Cyg_HardwareThread::thread_entry( Cyg_Th { CYG_REPORT_FUNCTION(); - Cyg_Scheduler::scheduler.clear_need_reschedule(); // finished rescheduling - Cyg_Scheduler::scheduler.set_current_thread(thread); // restore current thread pointer - - CYG_INSTRUMENT_THREAD(ENTER,thread,0); + // Call the scheduler to do any housekeeping + Cyg_Scheduler::scheduler.thread_entry( thread ); -#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE - // Reset the timeslice counter so that this thread gets a full - // quantum. - Cyg_Scheduler::reset_timeslice_count(); -#endif - - // Zero the lock - HAL_REORDER_BARRIER (); // Prevent the compiler from moving - Cyg_Scheduler::zero_sched_lock(); // the assignment into the code above. - HAL_REORDER_BARRIER(); - // Call entry point in a loop. - for(;;) { thread->entry_point(thread->entry_data); @@ -1225,11 +1211,11 @@ Cyg_ThreadTimer::alarm( # endif // CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE #endif // CYGNUM_HAL_STACK_SIZE_MINIMUM -static char idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE]; - // Loop counter for debugging/housekeeping cyg_uint32 idle_thread_loops[CYGNUM_KERNEL_CPU_MAX]; +static char idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE]; + // ------------------------------------------------------------------------- // Idle thread code.
