summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/keysetspecific.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-12 14:22:22 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-07-15 10:03:48 -0500
commit64939bc9efcaf945b493e9c371901de33c3868a3 (patch)
treee196959688afe714c8c334f93598cb99234970e4 /cpukit/posix/src/keysetspecific.c
parentrbtree: Delete unused functions (diff)
downloadrtems-64939bc9efcaf945b493e9c371901de33c3868a3.tar.bz2
rbtree: Reduce RBTree_Control size
Remove compare function and is unique indicator from the control structure. Rename RBTree_Compare_function to RBTree_Compare. Rename rtems_rbtree_compare_function to rtems_rbtree_compare. Provide C++ compatible initializers. Add compare function and is unique indicator to _RBTree_Find(), _RBTree_Insert(), rtems_rbtree_find() and rtems_rbtree_insert(). Remove _RBTree_Is_unique() and rtems_rbtree_is_unique(). Remove compare function and is unique indicator from _RBTree_Initialize_empty() and rtems_rbtree_initialize_empty().
Diffstat (limited to 'cpukit/posix/src/keysetspecific.c')
-rw-r--r--cpukit/posix/src/keysetspecific.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c
index 3284991edb..0f7c682506 100644
--- a/cpukit/posix/src/keysetspecific.c
+++ b/cpukit/posix/src/keysetspecific.c
@@ -44,12 +44,8 @@ int pthread_setspecific(
switch ( location ) {
case OBJECTS_LOCAL:
- search_node.key = key;
- search_node.thread_id = _Thread_Executing->Object.id;
- p = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree,
- &search_node.Key_value_lookup_node );
-
- if ( p ) {
+ p = _POSIX_Keys_Find( key, _Thread_Executing->Object.id, &search_node );
+ if ( p != NULL ) {
value_pair_ptr = _RBTree_Container_of( p,
POSIX_Keys_Key_value_pair,
Key_value_lookup_node );
@@ -69,8 +65,12 @@ int pthread_setspecific(
value_pair_ptr->value = value;
/* The insert can only go wrong if the same node is already in a unique
* tree. This has been already checked with the _RBTree_Find() */
- (void) _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree,
- &(value_pair_ptr->Key_value_lookup_node) );
+ _RBTree_Insert(
+ &_POSIX_Keys_Key_value_lookup_tree,
+ &value_pair_ptr->Key_value_lookup_node,
+ _POSIX_Keys_Key_value_compare,
+ true
+ );
/** append rb_node to the thread API extension's chain */
_Chain_Append_unprotected(