summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems/posix/keyimpl.h
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/include/rtems/posix/keyimpl.h
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/include/rtems/posix/keyimpl.h')
-rw-r--r--cpukit/posix/include/rtems/posix/keyimpl.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h
index 6aab2449c6..b21c1d30fc 100644
--- a/cpukit/posix/include/rtems/posix/keyimpl.h
+++ b/cpukit/posix/include/rtems/posix/keyimpl.h
@@ -42,7 +42,7 @@ POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
/**
* @brief The rbtree control block used to manage all key values
*/
-POSIX_EXTERN RBTree_Control _POSIX_Keys_Key_value_lookup_tree;
+extern RBTree_Control _POSIX_Keys_Key_value_lookup_tree;
/**
* @brief This freechain is used as a memory pool for POSIX_Keys_Key_value_pair.
@@ -61,7 +61,7 @@ void _POSIX_Key_Manager_initialization(void);
*
* This routine compares the rbtree node
*/
-int _POSIX_Keys_Key_value_lookup_tree_compare_function(
+int _POSIX_Keys_Key_value_compare(
const RBTree_Node *node1,
const RBTree_Node *node2
);
@@ -165,6 +165,23 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free(
_Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair );
}
+RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Find(
+ pthread_key_t key,
+ Objects_Id thread_id,
+ POSIX_Keys_Key_value_pair *search_node
+)
+{
+ search_node->key = key;
+ search_node->thread_id = thread_id;
+
+ return _RBTree_Find(
+ &_POSIX_Keys_Key_value_lookup_tree,
+ &search_node->Key_value_lookup_node,
+ _POSIX_Keys_Key_value_compare,
+ true
+ );
+}
+
/** @} */
#ifdef __cplusplus