diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2003-04-02 03:05:39 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2003-04-02 03:05:39 +0000 |
| commit | 26f52e2f8b92ffea807005dc15866b2cf79ed3ac (patch) | |
| tree | 3edb86617f8b88a54083b0eeb1e45c1b253d05e0 /lib/libthr/thread/thr_spec.c | |
| parent | dd3dd8724dcceea872de0aea7ef8baabb3ba808c (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread/thr_spec.c')
| -rw-r--r-- | lib/libthr/thread/thr_spec.c | 11 |
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: */ |
