forked from Imagelibrary/rtems
score: _Objects_Get_name_as_string()
Avoid Giant lock in _Objects_Get_name_as_string(). Update #2555.
This commit is contained in:
@@ -41,7 +41,7 @@ char *_Objects_Get_name_as_string(
|
||||
uint32_t i;
|
||||
char lname[5];
|
||||
Objects_Control *the_object;
|
||||
Objects_Locations location;
|
||||
ISR_lock_Context lock_context;
|
||||
Objects_Id tmpId;
|
||||
|
||||
if ( length == 0 )
|
||||
@@ -56,10 +56,10 @@ char *_Objects_Get_name_as_string(
|
||||
if ( !information )
|
||||
return NULL;
|
||||
|
||||
the_object = _Objects_Get( information, tmpId, &location );
|
||||
switch ( location ) {
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
the_object = _Objects_Get_local( tmpId, information, &lock_context );
|
||||
if ( the_object == NULL ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
|
||||
if ( information->is_string ) {
|
||||
@@ -85,16 +85,6 @@ char *_Objects_Get_name_as_string(
|
||||
}
|
||||
*d = '\0';
|
||||
|
||||
_Objects_Put( the_object );
|
||||
_ISR_lock_ISR_enable( &lock_context );
|
||||
return name;
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
case OBJECTS_REMOTE:
|
||||
/* not supported */
|
||||
#endif
|
||||
case OBJECTS_ERROR:
|
||||
return NULL;
|
||||
|
||||
}
|
||||
return NULL; /* unreachable path */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user