diff packages/kernel/current/include/sched.inl @ 115:6ed91473a1cd ecos-sw-2000-08-21

Merge from eCos master repository on 2000-08-21-22:40:54-BST
author jlarmour
date Fri, 25 Aug 2000 17:32:38 +0000
parents bf00f99aec69
children 0ec04793409a
line wrap: on
line diff
--- a/packages/kernel/current/include/sched.inl
+++ b/packages/kernel/current/include/sched.inl
@@ -89,12 +89,24 @@ inline void Cyg_Scheduler::unlock()
     
     cyg_ucount32 __lock = sched_lock - 1;
     
-    if( __lock == 0 ) unlock_inner();
+    if( __lock == 0 ) unlock_inner(0);
     else sched_lock = __lock;
 
     HAL_REORDER_BARRIER();
 }
 
+inline void Cyg_Scheduler::reschedule()
+{
+    // This function performs the equivalent of calling unlock() and
+    // lock() is succession. Unlike that pair, however, it does not
+    // leave a brief window between the calls when the lock is unclaimed
+    // by the current thread.
+    
+    CYG_INSTRUMENT_SCHED(RESCHEDULE,sched_lock,0);
+    
+    unlock_inner( sched_lock );
+}
+
 inline void Cyg_Scheduler::unlock_simple()
 {
     // This function decrements the lock, but does not call unlock_inner().