summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_spec.c')
-rw-r--r--lib/libthr/thread/thr_spec.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/libthr/thread/thr_spec.c b/lib/libthr/thread/thr_spec.c
index 07ef3875b365..eefae51d0085 100644
--- a/lib/libthr/thread/thr_spec.c
+++ b/lib/libthr/thread/thr_spec.c
@@ -102,7 +102,6 @@ _pthread_key_delete(pthread_key_t key)
void
_thread_cleanupspecific(void)
{
- struct pthread *curthread = _get_curthread();
void *data = NULL;
int key;
int itr;
@@ -165,11 +164,8 @@ pthread_key_allocate_data(void)
int
_pthread_setspecific(pthread_key_t key, const void *value)
{
- struct pthread *pthread;
int ret = 0;
-
- /* Point to the running thread: */
- pthread = _get_curthread();
+ pthread_t pthread = curthread;
if ((pthread->specific) ||
(pthread->specific = pthread_key_allocate_data())) {
@@ -198,12 +194,9 @@ _pthread_setspecific(pthread_key_t key, const void *value)
void *
_pthread_getspecific(pthread_key_t key)
{
- struct pthread *pthread;
+ pthread_t pthread = curthread;
void *data;
- /* Point to the running thread: */
- pthread = _get_curthread();
-
/* Check if there is specific data: */
if (pthread->specific != NULL && key < PTHREAD_KEYS_MAX) {
/* Check if this key has been used before: */