Mercurial > flash_v2
diff packages/kernel/current/src/sync/mutex.cxx @ 124:0ec04793409a ecos-sw-2000-09-11
Merge from eCos master repository on 2000-09-11-03:00:13-BST
| author | jlarmour |
|---|---|
| date | Mon, 11 Sep 2000 02:42:46 +0000 |
| parents | 6ed91473a1cd |
| children | 4c750ce71ae3 |
line wrap: on
line diff
--- a/packages/kernel/current/src/sync/mutex.cxx +++ b/packages/kernel/current/src/sync/mutex.cxx @@ -557,11 +557,7 @@ Cyg_Condition_Variable::wait_inner( Cyg_ cyg_bool result = true; Cyg_Thread *self = Cyg_Thread::self(); - cyg_int32 current_lock = Cyg_Scheduler::get_sched_lock(); - - if (current_lock == 0) - // Prevent preemption - Cyg_Scheduler::lock(); + Cyg_Scheduler::lock(); CYG_ASSERTCLASS( this, "Bad this pointer"); CYG_ASSERTCLASS( mx, "Corrupt mutex"); @@ -577,13 +573,11 @@ Cyg_Condition_Variable::wait_inner( Cyg_ queue.enqueue( self ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); - // Avoid calling ASRs during the following unlock. self->set_asr_inhibit(); // Unlock the scheduler and switch threads - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); // Allow ASRs again self->clear_asr_inhibit(); @@ -626,10 +620,6 @@ Cyg_Condition_Variable::wait_inner( Cyg_ CYG_REPORT_RETURN(); - if (current_lock) - // Reacquire the DSR pseudo lock - Cyg_Scheduler::lock(); - return result; } @@ -752,13 +742,11 @@ Cyg_Condition_Variable::wait_inner( Cyg_ if( self->get_wake_reason() == Cyg_Thread::NONE ) queue.enqueue( self ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); - // Avoid calling ASRs during the following unlock. self->set_asr_inhibit(); // Unlock the scheduler and switch threads - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); // Allow ASRs again self->clear_asr_inhibit();
