diff options
author | davidxu <davidxu@FreeBSD.org> | 2007-11-19 02:09:07 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2007-11-19 02:09:07 +0000 |
commit | 4b62b76062a80ed020e5876c719f318637b318e7 (patch) | |
tree | fa3bb5e6cd60e896c255902f72aa23ae3c024946 /lib | |
parent | bdea99cbc228b34035142dfef7483a3b8fce9700 (diff) | |
download | FreeBSD-src-4b62b76062a80ed020e5876c719f318637b318e7.zip FreeBSD-src-4b62b76062a80ed020e5876c719f318637b318e7.tar.gz |
MFlibthr:
In _pthread_key_create() ensure that libkse is initialized.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_spec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libkse/thread/thr_spec.c b/lib/libkse/thread/thr_spec.c index 6059375..1cfe1b1 100644 --- a/lib/libkse/thread/thr_spec.c +++ b/lib/libkse/thread/thr_spec.c @@ -90,9 +90,13 @@ _pthread_key_create(pthread_key_t *key, void (*destructor) (void *)) int _pthread_key_delete(pthread_key_t key) { - struct pthread *curthread = _get_curthread(); + struct pthread *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); |