From 81cb5487d08c59fca0190cf03a07bdf45fe90ea8 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 2 May 2005 22:00:34 +0000 Subject: libpthread/ 2005-05-02 Neal H. Walfield * pthread/pt-alloc.c (__pthread_alloc): Set the thread id to the table index plus one. * pthread/pt-internal.h (__pthread_getid): Index __pthread_threads using THREAD - 1, not THREAD. (__pthread_setid): Likewise. * pthread/pt-create.c (__pthread_create_internal): Likewise. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): When returning EBUSY, don't forget to first unlock MUTEX->__HELD. --- pthread/pt-create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pthread/pt-create.c') diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 0295a0a..cf5b32d 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -1,5 +1,5 @@ /* Thread creation. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -168,7 +168,7 @@ __pthread_create_internal (struct __pthread **thread, other thread should be using this entry (we also assume that the store is atomic). */ pthread_rwlock_rdlock (&__pthread_threads_lock); - __pthread_threads[pthread->thread] = pthread; + __pthread_threads[pthread->thread - 1] = pthread; pthread_rwlock_unlock (&__pthread_threads_lock); /* At this point it is possible to guess our pthread ID. We have to -- cgit v1.2.3