forked from Imagelibrary/rtems
Swapped order of nested acquisition check and check for returning unsatisfied.
This commit is contained in:
@@ -122,12 +122,6 @@ void _CORE_mutex_Seize(
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !wait ) {
|
||||
_ISR_Enable( level );
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( _Objects_Are_ids_equal(
|
||||
_Thread_Executing->Object.id, the_mutex->holder_id ) ) {
|
||||
if ( _CORE_mutex_Is_nesting_allowed( &the_mutex->Attributes ) )
|
||||
@@ -139,6 +133,12 @@ void _CORE_mutex_Seize(
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !wait ) {
|
||||
_ISR_Enable( level );
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
|
||||
return;
|
||||
}
|
||||
|
||||
_Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
|
||||
executing->Wait.queue = &the_mutex->Wait_queue;
|
||||
executing->Wait.id = id;
|
||||
|
||||
@@ -122,12 +122,6 @@ void _CORE_mutex_Seize(
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !wait ) {
|
||||
_ISR_Enable( level );
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( _Objects_Are_ids_equal(
|
||||
_Thread_Executing->Object.id, the_mutex->holder_id ) ) {
|
||||
if ( _CORE_mutex_Is_nesting_allowed( &the_mutex->Attributes ) )
|
||||
@@ -139,6 +133,12 @@ void _CORE_mutex_Seize(
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !wait ) {
|
||||
_ISR_Enable( level );
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
|
||||
return;
|
||||
}
|
||||
|
||||
_Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
|
||||
executing->Wait.queue = &the_mutex->Wait_queue;
|
||||
executing->Wait.id = id;
|
||||
|
||||
Reference in New Issue
Block a user