Mercurial > flash_v2
comparison packages/kernel/current/src/common/kapi.cxx @ 56:755351606154 ecos-sw-1999-12-01
Merge from eCos master repository on 1999-12-01-18:03:05-GMT
| author | jlarmour |
|---|---|
| date | Wed, 01 Dec 1999 18:33:37 +0000 |
| parents | e7ba79f6d3a8 |
| children | c38311975d4f |
comparison
equal
deleted
inserted
replaced
| 55:05cdf76cd56c | 56:755351606154 |
|---|---|
| 106 | 106 |
| 107 /* Lock the scheduler. */ | 107 /* Lock the scheduler. */ |
| 108 externC void cyg_scheduler_lock(void) | 108 externC void cyg_scheduler_lock(void) |
| 109 { | 109 { |
| 110 Cyg_Scheduler::lock(); | 110 Cyg_Scheduler::lock(); |
| 111 // get_sched_lock() is unsigned, see below "cyg_ucount32 lock" | |
| 112 CYG_ASSERT( (0xff000000 & (Cyg_Scheduler::get_sched_lock())) == 0, | |
| 113 "Scheduler overlocked" ); | |
| 111 } | 114 } |
| 112 | 115 |
| 113 /* Unlock the scheduler. */ | 116 /* Unlock the scheduler. */ |
| 114 externC void cyg_scheduler_unlock(void) | 117 externC void cyg_scheduler_unlock(void) |
| 115 { | 118 { |
| 116 Cyg_Scheduler::unlock(); | 119 cyg_ucount32 slock = Cyg_Scheduler::get_sched_lock(); |
| 120 CYG_ASSERT( 0 < slock, "Scheduler not locked" ); | |
| 121 // And program defensively too: | |
| 122 if ( 0 < slock ) | |
| 123 Cyg_Scheduler::unlock(); | |
| 117 } | 124 } |
| 118 | 125 |
| 119 /*---------------------------------------------------------------------------*/ | 126 /*---------------------------------------------------------------------------*/ |
| 120 /* Thread operations */ | 127 /* Thread operations */ |
| 121 | 128 |
