diff packages/kernel/current/include/mboxt.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 e0c0827131d1
line wrap: on
line diff
--- a/packages/kernel/current/include/mboxt.inl
+++ b/packages/kernel/current/include/mboxt.inl
@@ -213,12 +213,9 @@ Cyg_Mboxt<T,QUEUE_SIZE>::get( T &ritem )
         get_threadq.enqueue( self );
 
         CYG_INSTRUMENT_MBOXT(WAIT, this, count);
-        CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(),
-                    "Called with non-zero scheduler lock");
         
-        // Unlock scheduler and allow other threads to run
-        Cyg_Scheduler::unlock();
-        Cyg_Scheduler::lock();
+        // Allow other threads to run
+        Cyg_Scheduler::reschedule();
 
         CYG_ASSERTCLASS( this, "Bad this pointer");        
 
@@ -303,12 +300,9 @@ Cyg_Mboxt<T,QUEUE_SIZE>::get( T &ritem, 
         get_threadq.enqueue( self );
 
         CYG_INSTRUMENT_MBOXT(WAIT, this, count);
-        CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(),
-                    "Called with non-zero scheduler lock");
         
-        // Unlock scheduler and allow other threads to run
-        Cyg_Scheduler::unlock();
-        Cyg_Scheduler::lock();
+        // Allow other threads to run
+        Cyg_Scheduler::reschedule();
 
         CYG_ASSERTCLASS( this, "Bad this pointer");        
 
@@ -448,11 +442,9 @@ Cyg_Mboxt<T,QUEUE_SIZE>::put( const T it
         put_threadq.enqueue( self );
 
         CYG_INSTRUMENT_MBOXT(WAIT, this, count);
-        CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(),
-                    "Called with non-zero scheduler lock");
-        
-        Cyg_Scheduler::unlock();        // unlock, maybe switch threads
-        Cyg_Scheduler::lock();
+
+        // Allow other threads to run
+        Cyg_Scheduler::reschedule();
 
         CYG_ASSERTCLASS( this, "Bad this pointer");        
 
@@ -534,12 +526,9 @@ Cyg_Mboxt<T,QUEUE_SIZE>::put( const T it
         put_threadq.enqueue( self );
 
         CYG_INSTRUMENT_MBOXT(WAIT, this, count);
-        CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(),
-                    "Called with non-zero scheduler lock");
 
-        // Unlock scheduler and allow other threads to run
-        Cyg_Scheduler::unlock();
-        Cyg_Scheduler::lock();
+        // Allow other threads to run
+        Cyg_Scheduler::reschedule();
 
         CYG_ASSERTCLASS( this, "Bad this pointer");