Move the added code in revision 1.26 into function pthread_key_create,

it should be there.
This commit is contained in:
davidxu 2007-11-26 02:35:17 +00:00
parent bae95962d0
commit 2179631991

View File

@ -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);