posix: Simplify _POSIX_Keys_Find()

This commit is contained in:
Sebastian Huber
2014-12-12 13:16:03 +01:00
parent 3feb3727a4
commit dac340dd66
4 changed files with 10 additions and 12 deletions
+7 -6
View File
@@ -169,17 +169,18 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free(
}
RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Find(
pthread_key_t key,
Thread_Control *thread,
POSIX_Keys_Key_value_pair *search_node
pthread_key_t key,
Thread_Control *thread
)
{
search_node->key = key;
search_node->thread = thread;
POSIX_Keys_Key_value_pair search_node;
search_node.key = key;
search_node.thread = thread;
return _RBTree_Find(
&_POSIX_Keys_Key_value_lookup_tree,
&search_node->Key_value_lookup_node,
&search_node.Key_value_lookup_node,
_POSIX_Keys_Key_value_compare,
true
);
+1 -2
View File
@@ -26,13 +26,12 @@ void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
POSIX_Keys_Key_value_pair search_node;
POSIX_Keys_Key_value_pair *p;
RBTree_Node *iter, *next;
Objects_Id key_id;
key_id = the_key->Object.id;
iter = _POSIX_Keys_Find( key_id, 0, &search_node );
iter = _POSIX_Keys_Find( key_id, 0 );
if ( !iter )
return;
/**
+1 -2
View File
@@ -40,7 +40,6 @@ void *pthread_getspecific(
{
POSIX_Keys_Control *the_key;
Objects_Locations location;
POSIX_Keys_Key_value_pair search_node;
RBTree_Node *p;
void *key_data;
POSIX_Keys_Key_value_pair *value_pair_p;
@@ -49,7 +48,7 @@ void *pthread_getspecific(
switch ( location ) {
case OBJECTS_LOCAL:
p = _POSIX_Keys_Find( key, _Thread_Executing, &search_node );
p = _POSIX_Keys_Find( key, _Thread_Executing );
if ( p != NULL ) {
value_pair_p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( p );
key_data = value_pair_p->value;
+1 -2
View File
@@ -38,7 +38,6 @@ int pthread_setspecific(
Objects_Locations location;
POSIX_Keys_Key_value_pair *value_pair_ptr;
RBTree_Node *p;
POSIX_Keys_Key_value_pair search_node;
Thread_Control *executing;
the_key = _POSIX_Keys_Get( key, &location );
@@ -46,7 +45,7 @@ int pthread_setspecific(
case OBJECTS_LOCAL:
executing = _Thread_Executing;
p = _POSIX_Keys_Find( key, executing, &search_node );
p = _POSIX_Keys_Find( key, executing );
if ( p != NULL ) {
value_pair_ptr = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( p );
value_pair_ptr->value = RTEMS_DECONST( void *, value );