summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/keysetspecific.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-08-02 15:49:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-08-05 09:30:37 +0200
commit390cfcda71c5bb0d53493210bcf4a15ee29c0498 (patch)
tree52d5af466eef00d0fd8f441f130aeb05131a21c5 /cpukit/posix/src/keysetspecific.c
parentrbtree: Add and use RBTree_Compare_result (diff)
downloadrtems-390cfcda71c5bb0d53493210bcf4a15ee29c0498.tar.bz2
posix: Simplify key implementation
Diffstat (limited to 'cpukit/posix/src/keysetspecific.c')
-rw-r--r--cpukit/posix/src/keysetspecific.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c
index ec17d47b8a..ee85ac2cb5 100644
--- a/cpukit/posix/src/keysetspecific.c
+++ b/cpukit/posix/src/keysetspecific.c
@@ -39,12 +39,14 @@ int pthread_setspecific(
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 );
switch ( location ) {
case OBJECTS_LOCAL:
- p = _POSIX_Keys_Find( key, _Thread_Executing->Object.id, &search_node );
+ executing = _Thread_Executing;
+ p = _POSIX_Keys_Find( key, executing, &search_node );
if ( p != NULL ) {
value_pair_ptr = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( p );
value_pair_ptr->value = value;
@@ -58,7 +60,7 @@ int pthread_setspecific(
}
value_pair_ptr->key = key;
- value_pair_ptr->thread_id = _Thread_Executing->Object.id;
+ value_pair_ptr->thread = executing;
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() */