diff packages/kernel/current/src/common/thread.cxx @ 2119:1406c9fadbf3

* src/sched/sched.cxx (thread_entry): Fixed a bug which could cause a thread to be started with a non-zero scheduler lock. The previous code only decremented it by 1 so if the previous thread was executing with the lock > 1 the thread ended up with a non-zero lock. This is fixed by decrementing the lock in a loop until it reaches zero. * src/common/thread.cxx (idle_thread_main): Added an assert for a non-zero scheduler lock.
author nickg
date Thu, 19 Jan 2006 17:53:58 +0000
parents 5d7f57fd1729
children ef95b9adfb61
line wrap: on
line diff
--- a/packages/kernel/current/src/common/thread.cxx
+++ b/packages/kernel/current/src/common/thread.cxx
@@ -1230,6 +1230,7 @@ idle_thread_main( CYG_ADDRESS data )
 
         HAL_IDLE_THREAD_ACTION(idle_thread_loops[CYG_KERNEL_CPU_THIS()]);
 
+        CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 0, "Scheduler lock not zero" );
 #if 0
         // For testing, it is useful to be able to fake
         // clock interrupts in the idle thread.