forked from Imagelibrary/rtems
score: Avoid Giant lock in _Objects_Id_to_name()
This prevents a deadlock situation in the capture engine.
This commit is contained in:
@@ -31,6 +31,7 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
|
|||||||
Objects_Information *information;
|
Objects_Information *information;
|
||||||
Objects_Control *the_object = (Objects_Control *) 0;
|
Objects_Control *the_object = (Objects_Control *) 0;
|
||||||
Objects_Locations ignored_location;
|
Objects_Locations ignored_location;
|
||||||
|
ISR_lock_Context lock_context;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Caller is trusted for name != NULL.
|
* Caller is trusted for name != NULL.
|
||||||
@@ -56,11 +57,16 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
|
|||||||
return OBJECTS_INVALID_ID;
|
return OBJECTS_INVALID_ID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
the_object = _Objects_Get( information, tmpId, &ignored_location );
|
the_object = _Objects_Get_isr_disable(
|
||||||
|
information,
|
||||||
|
tmpId,
|
||||||
|
&ignored_location,
|
||||||
|
&lock_context
|
||||||
|
);
|
||||||
if ( !the_object )
|
if ( !the_object )
|
||||||
return OBJECTS_INVALID_ID;
|
return OBJECTS_INVALID_ID;
|
||||||
|
|
||||||
*name = the_object->name;
|
*name = the_object->name;
|
||||||
_Objects_Put( the_object );
|
_ISR_lock_ISR_enable( &lock_context );
|
||||||
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
|
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user