/[hurd]/hurd/libpthread/pthread/pt-alloc.c
ViewVC logotype

Diff of /hurd/libpthread/pthread/pt-alloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by neal, Thu Oct 10 23:05:06 2002 UTC revision 1.2 by neal, Mon May 2 22:00:34 2005 UTC
# Line 1  Line 1 
1  /* Allocate a new thread structure.  /* Allocate a new thread structure.
2     Copyright (C) 2000, 2002 Free Software Foundation, Inc.     Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4    
5     The GNU C Library is free software; you can redistribute it and/or     The GNU C Library is free software; you can redistribute it and/or
# Line 139  __pthread_alloc (struct __pthread **pthr Line 139  __pthread_alloc (struct __pthread **pthr
139    
140    if (__pthread_num_threads < __pthread_max_threads)    if (__pthread_num_threads < __pthread_max_threads)
141      {      {
142        /* We have a free slot.  Use the slot number as        /* We have a free slot.  Use the slot number plus one as the
143           the thread ID for the new thread.  */           thread ID for the new thread.  */
144        new->thread = __pthread_num_threads++;        new->thread = 1 + __pthread_num_threads++;
145        __pthread_threads[new->thread] = NULL;        __pthread_threads[new->thread - 1] = NULL;
146    
147        pthread_rwlock_unlock (&__pthread_threads_lock);        pthread_rwlock_unlock (&__pthread_threads_lock);
148    
# Line 203  __pthread_alloc (struct __pthread **pthr Line 203  __pthread_alloc (struct __pthread **pthr
203    __pthread_threads = threads;    __pthread_threads = threads;
204    
205    /* And allocate ourselves one of the newly created slots.  */    /* And allocate ourselves one of the newly created slots.  */
206    new->thread = __pthread_num_threads++;    new->thread = 1 + __pthread_num_threads++;
207    __pthread_threads[new->thread] = NULL;    __pthread_threads[new->thread - 1] = NULL;
208    
209    pthread_rwlock_unlock (&__pthread_threads_lock);    pthread_rwlock_unlock (&__pthread_threads_lock);
210    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26