diff options
author | davidxu <davidxu@FreeBSD.org> | 2007-11-26 02:35:17 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2007-11-26 02:35:17 +0000 |
commit | 2179631991e01f5cac08108afc2fb3758fa63d30 (patch) | |
tree | bab20b0536042f877db7abec0d244fda529d698b /lib/libkse | |
parent | bae95962d033bd47ab35fb4a2990caa045fecced (diff) | |
download | FreeBSD-src-2179631991e01f5cac08108afc2fb3758fa63d30.zip FreeBSD-src-2179631991e01f5cac08108afc2fb3758fa63d30.tar.gz |
Move the added code in revision 1.26 into function pthread_key_create,
it should be there.
Diffstat (limited to 'lib/libkse')
-rw-r--r-- | lib/libkse/thread/thr_spec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libkse/thread/thr_spec.c b/lib/libkse/thread/thr_spec.c index 1cfe1b1..f373d8e 100644 --- a/lib/libkse/thread/thr_spec.c +++ b/lib/libkse/thread/thr_spec.c @@ -63,9 +63,13 @@ __weak_reference(_pthread_setspecific, pthread_setspecific); int _pthread_key_create(pthread_key_t *key, void (*destructor) (void *)) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; int i; + if (_thr_initial == NULL) + _libpthread_init(NULL); + curthread = _get_curthread(); + /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); for (i = 0; i < PTHREAD_KEYS_MAX; i++) { @@ -90,13 +94,9 @@ _pthread_key_create(pthread_key_t *key, void (*destructor) (void *)) int _pthread_key_delete(pthread_key_t key) { - struct pthread *curthread; + struct pthread *curthread = _get_curthread(); int ret = 0; - if (_thr_initial == NULL) - _libpthread_init(NULL); - curthread = _get_curthread(); - if ((unsigned int)key < PTHREAD_KEYS_MAX) { /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); |