comparison packages/kernel/current/src/common/kapi.cxx @ 4:1d7f19c9e4d1 ecos-sw-1999-05-11

Merge from eCos master repository on 1999-05-11-21:11:10-BST
author jlarmour
date Tue, 11 May 1999 14:07:25 +0000
parents 443894e2e912
children ece80412419a
comparison
equal deleted inserted replaced
3:69e820d8bae1 4:1d7f19c9e4d1
102 externC void cyg_scheduler_start(void) 102 externC void cyg_scheduler_start(void)
103 { 103 {
104 Cyg_Scheduler::start(); 104 Cyg_Scheduler::start();
105 } 105 }
106 106
107 /* Lock the scheduler. We only allow this to take the lock from */ 107 /* Lock the scheduler. */
108 /* zero to 1. Any other transition implies that this function */
109 /* is being called from an ISR/DSR or some other illegal place. */
110 externC void cyg_scheduler_lock(void) 108 externC void cyg_scheduler_lock(void)
111 { 109 {
112 Cyg_Scheduler::lock(); 110 Cyg_Scheduler::lock();
113 111 }
114 CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1 , 112
115 "Cannot nest calls to cyg_scheduler_lock"); 113 /* Unlock the scheduler. */
116
117 if( Cyg_Scheduler::get_sched_lock() != 1 )
118 Cyg_Scheduler::unlock();
119 }
120
121 /* Unlock the scheduler. Like lock, we only allow a 1->0 */
122 /* transition. */
123 externC void cyg_scheduler_unlock(void) 114 externC void cyg_scheduler_unlock(void)
124 { 115 {
125 CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1 , 116 Cyg_Scheduler::unlock();
126 "Bad call to cyg_scheduler_unlock");
127
128 if( Cyg_Scheduler::get_sched_lock() == 1 )
129 Cyg_Scheduler::unlock();
130
131 } 117 }
132 118
133 /*---------------------------------------------------------------------------*/ 119 /*---------------------------------------------------------------------------*/
134 /* Thread operations */ 120 /* Thread operations */
135 121