summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/keysetspecific.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-04 08:18:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 09:08:21 +0200
commit9ea69deef0257cb54f2f551bdb60a8d587260135 (patch)
treeca803e08a658963d67c227ddc0d4380726c72de9 /cpukit/posix/src/keysetspecific.c
parentposix: Fix _POSIX_signals_Check_signal() (diff)
downloadrtems-9ea69deef0257cb54f2f551bdb60a8d587260135.tar.bz2
score: Add node map to _RBTree_Find_inline()
Diffstat (limited to 'cpukit/posix/src/keysetspecific.c')
-rw-r--r--cpukit/posix/src/keysetspecific.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c
index 8b0f517eaf..7034d8eb65 100644
--- a/cpukit/posix/src/keysetspecific.c
+++ b/cpukit/posix/src/keysetspecific.c
@@ -24,11 +24,11 @@
#include <errno.h>
-static int _POSIX_Keys_Set_value( RBTree_Node *node, const void *value )
+static int _POSIX_Keys_Set_value(
+ POSIX_Keys_Key_value_pair *key_value_pair,
+ const void *value
+)
{
- POSIX_Keys_Key_value_pair *key_value_pair;
-
- key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
key_value_pair->value = RTEMS_DECONST( void *, value );
return 0;
@@ -91,16 +91,13 @@ static int _POSIX_Keys_Delete_value(
the_key = _POSIX_Keys_Get( key );
if ( the_key != NULL ) {
- ISR_lock_Context lock_context;
- RBTree_Node *node;
+ POSIX_Keys_Key_value_pair *key_value_pair;
+ ISR_lock_Context lock_context;
_POSIX_Keys_Key_value_acquire( executing, &lock_context );
- node = _POSIX_Keys_Key_value_find( key, executing );
- if ( node != NULL ) {
- POSIX_Keys_Key_value_pair *key_value_pair;
-
- key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
+ key_value_pair = _POSIX_Keys_Key_value_find( key, executing );
+ if ( key_value_pair != NULL ) {
_RBTree_Extract(
&executing->Keys.Key_value_pairs,
&key_value_pair->Lookup_node
@@ -138,14 +135,14 @@ int pthread_setspecific(
executing = _Thread_Get_executing();
if ( value != NULL ) {
- ISR_lock_Context lock_context;
- RBTree_Node *node;
+ ISR_lock_Context lock_context;
+ POSIX_Keys_Key_value_pair *key_value_pair;
_POSIX_Keys_Key_value_acquire( executing, &lock_context );
- node = _POSIX_Keys_Key_value_find( key, executing );
- if ( node != NULL ) {
- eno = _POSIX_Keys_Set_value( node, value );
+ key_value_pair = _POSIX_Keys_Key_value_find( key, executing );
+ if ( key_value_pair != NULL ) {
+ eno = _POSIX_Keys_Set_value( key_value_pair, value );
_POSIX_Keys_Key_value_release( executing, &lock_context );
} else {
_POSIX_Keys_Key_value_release( executing, &lock_context );