* elf/dl-load.c (_dl_map_object_from_fd): Use l_addr instead of
[glibc.git] / linuxthreads / ChangeLog
blob2ed5382a7030b33e9784a399f84510ca28f0640a
1 2002-09-04  Bruno Haible  <bruno@clisp.org>
3         * pthread.c: Include <sys/time.h>.
4         (is_smp_system): Move to sysdeps/unix/sysv/linux/smp.h.
5         * sysdeps/unix/sysv/linux/smp.h: New file, extracted from pthread.c.
6         * Makefile (distribute): Add smp.h to the list.
8 2002-09-04  Bruno Haible  <bruno@clisp.org>
10         * sysdeps/alpha/pt-machine.h: Choose different include file location
11         on non-Linux platforms.
13         * wrapsyscall.c (PROMOTE_INTEGRAL_TYPE): New macro.
14         (open, open64): Change va_arg argument type to the integral type to
15         which mode_t promotes.
17         * sysdeps/pthread/tst-timer.c (main): Don't assume anything about
18         the structure of 'struct sigevent'.
20         * errno.c (__errno_location, __h_errno_location, __res_state):
21         Use prototype function definitions.
23 2002-07-29  Steven Munroe  <sjmunroe@us.ibm.com>
25         * shlib-versions: Set libpthread version to 2.3 for powerpc64.
26         * sysdeps/powerpc/pt-machine.h: moved to...
27         * sysdeps/powerpc/powerpc32/pt-machine.h: ...here
28         * sysdeps/powerpc/powerpc64/pt-machine.h: New file.
30 2002-09-02  Roland McGrath  <roland@redhat.com>
32         * sysdeps/powerpc/Makefile (CFLAGS-pt-initfini.s): New variable.
34 2002-09-01  Roland McGrath  <roland@redhat.com>
36         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t): Add new keys
37         CTYPE_B, CTYPE_TOLOWER, CTYPE_TOUPPER.
39         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_address): New macro.
40         (__libc_internal_tsd_address): Declare it.
41         * Versions (libc, ld, libpthread: GLIBC_PRIVATE): Add
42         __libc_internal_tsd_address.
43         * specific.c (libc_internal_tsd_address): New function.
44         (__libc_internal_tsd_address): New variable.
45         * no-tsd.c (__libc_internal_tsd_address): New variable.
47 2002-08-31  Ulrich Drepper  <drepper@redhat.com>
49         * Makefile: Don't use rule for crt%.o, spell it out as rules for
50         crti.o and crtn.o.
52 2002-08-30  Roland McGrath  <roland@redhat.com>
54         * Makefile (extra-objs, omit-deps): Add crtn.
55         ($(objpfx)libpthread.so): Depend on $(objpfx)crtn.o.
56         ($(objpfx)libpthread.so: +postinit): Append $(objpfx)crtn.o.
57         ($(objpfx)crtn.S): New target.
58         ($(objpfx)crt%.o): Pattern rule replaces crti.o target.
59         (generated): Add crtn.S.
61         * sysdeps/unix/sysv/linux/x86_64/Makefile ($(objpfx)specs): Massage
62         crtn.o pathname too.
64 2002-08-30  Jakub Jelinek  <jakub@redhat.com>
66         * pthread.c (__pthread_initialize_minimal): Call __uselocale even
67         if [! SHARED].
69 2002-08-30  Roland McGrath  <roland@redhat.com>
71         * tst-static-locale.c: New file.
72         * Makefile (tests, tests-static): Add it.
74 2002-04-24  Steven Munroe  <sjmunroe@us.ibm.com>
76         * spinlock.c (__pthread_lock): Fix spurious wakeup
77         handling.  Don't clear lowest bit of list pointer as sign the thread
78         is still on the wait list.  Don't restart after spurious wakeup
79         with spinning to get the lock.
80         (__pthread_unlock): Take set lowest bit into account when handling
81         pointer to list elements.
82         Patch by Steve Munroe <sjmunroe@us.ibm.com>.
84 2002-08-28  Roland McGrath  <roland@redhat.com>
86         * sysdeps/pthread/timer_routines.c (thread_func): Fix type in cast.
88 2002-08-28  Jakub Jelinek  <jakub@redhat.com>
90         * sysdeps/unix/sysv/linux/hppa/aio_cancel.c: New file.
91         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
92         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
94 2002-08-28  Ulrich Drepper  <drepper@redhat.com>
96         * sysdeps/pthread/timer_routines.c (thread_func): Change return
97         type to void and add casts in use to avoid warnings with all gcc
98         versions.
100 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
102         * sysdeps/unix/sysv/linux/bits/local_lim.h (PTHREAD_THREADS_MAX):
103         Bump to 16384.
104         * manager.c (__pthread_handles): Remove.
105         * pthandles.c: New file.
106         * pthread.c (__pthread_initialize_minimal): Initialize
107         __pthread_handles[0] and __pthread_handles[1].
108         * Makefile (libpthread-routines): Add pthandles (must be last).
110 2002-08-26  Brian Youmans  <3diff@gnu.org>
112         * Examples/ex10.c: Corrected version number in Lesser GPL copying
113         permission notice from 2 to 2.1.
114         * Examples/ex11.c: Likewise.
115         * Examples/ex13.c: Likewise.
116         * Examples/ex8.c: Likewise.
117         * Examples/ex9.c: Likewise.
118         * barrier.c: Likewise.
119         * events.c: Likewise.
120         * lockfile.c: Likewise.
121         * no-tsd.c: Likewise.
122         * pt-machine.c: Likewise.
123         * ptclock_gettime.c: Likewise.
124         * ptclock_settime.c: Likewise.
125         * rwlock.c: Likewise.
126         * sysdeps/alpha/pspinlock.c: Likewise.
127         * sysdeps/alpha/pt-machine.h: Likewise.
128         * sysdeps/arm/pspinlock.c: Likewise.
129         * sysdeps/arm/pt-machine.h: Likewise.
130         * sysdeps/cris/pspinlock.c: Likewise.
131         * sysdeps/cris/pt-machine.h: Likewise.
132         * sysdeps/hppa/pspinlock.c: Likewise.
133         * sysdeps/hppa/pt-machine.h: Likewise.
134         * sysdeps/i386/i686/pt-machine.h: Likewise.
135         * sysdeps/i386/pspinlock.c: Likewise.
136         * sysdeps/i386/pt-machine.h: Likewise.
137         * sysdeps/i386/useldt.h: Likewise.
138         * sysdeps/ia64/pspinlock.c: Likewise.
139         * sysdeps/ia64/pt-machine.h: Likewise.
140         * sysdeps/m68k/pspinlock.c: Likewise.
141         * sysdeps/m68k/pt-machine.h: Likewise.
142         * sysdeps/mips/pspinlock.c: Likewise.
143         * sysdeps/mips/pt-machine.h: Likewise.
144         * sysdeps/powerpc/pspinlock.c: Likewise.
145         * sysdeps/powerpc/pt-machine.h: Likewise.
146         * sysdeps/pthread/bits/initspin.h: Likewise.
147         * sysdeps/pthread/bits/libc-lock.h: Likewise.
148         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
149         * sysdeps/pthread/getcpuclockid.c: Likewise.
150         * sysdeps/pthread/posix-timer.h: Likewise.
151         * sysdeps/pthread/timer_create.c: Likewise.
152         * sysdeps/pthread/timer_delete.c: Likewise.
153         * sysdeps/pthread/timer_getoverr.c: Likewise.
154         * sysdeps/pthread/timer_gettime.c: Likewise.
155         * sysdeps/pthread/timer_routines.c: Likewise.
156         * sysdeps/pthread/timer_settime.c: Likewise.
157         * sysdeps/pthread/tst-timer.c: Likewise.
158         * sysdeps/s390/pspinlock.c: Likewise.
159         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
160         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
161         * sysdeps/sh/pspinlock.c: Likewise.
162         * sysdeps/sh/pt-machine.h: Likewise.
163         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
164         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
165         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
166         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
167         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
168         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
169         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
170         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
171         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
172         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
173         * tststack.c: Likewise.
174         * unload.c: Likewise.
175         * weaks.c: Likewise.
176         * wrapsyscall.c: Likewise.
178         * sysdeps/pthread/pt-initfini.c: Changed copying
179         permission notice to Lesser GPL from Library GPL, including the
180         references in the special exception.
181         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: Likewise.
182         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Likewise.
183         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c:
184         Likewise.
185         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c:
186         Likewise.
187         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Likewise.
189 2002-08-26  Ulrich Drepper  <drepper@redhat.com>
191         * Examples/ex10.c (thread): tv_nsec == 1000000000 is already
192         overflow [PR libc/4244].
194 2002-08-25  Ulrich Drepper  <drepper@redhat.com>
196         * sysdeps/pthread/timer_routines.c (thread_func): Make the
197         compiler happy by adding a return statement which will never be
198         reached.
200         * tst-context.c (main): Cast to long before casting to pointer.
202         * Examples/ex17.c (main): Use correct format string.
204         * Examples/ex9.c (thread): Remove incorrect return statement.
206 2002-08-23  Ulrich Drepper  <drepper@redhat.com>
208         * pthread.c (__linuxthreads_version): New global constant.
210 2002-08-23  Andreas Jaeger  <aj@suse.de>
212         * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
213         as thread specific register.
214         (testandset): Fix inline asm.
215         (THREAD_GETMEM): Fix inline asm.
217 2002-08-22  Roland McGrath  <roland@redhat.com>
219         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
220         conditional.
221         (INIT_THREAD_SELF): Pass second arg to DO_SET_THREAD_AREA.
222         (DO_SET_THREAD_AREA): Take second arg, pass to DO_SET_THREAD_AREA_REUSE
223         macro.  That chooses whether to reuse %gs value or let kernel set it.
224         [USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, always 1.
225         [!USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, true if arg is
226         not constant 0.
228 2002-08-21  Ulrich Drepper  <drepper@redhat.com>
230         * sysdeps/i386/tls.h (TLS_SETUP_GS_SEGMENT): Add new parameter
231         also to the third definition of this macro.
233 2002-06-17  Andreas Jaeger  <aj@suse.de>
235         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
236         Set it.
238 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
240         * sysdeps/i386/useldt.h: Go back to using 16-bit instructions when
241         loading/reading segment registers.  Some old hardware doesn't
242         handle the 32-bit instructions as expected.
243         * sysdeps/i386/tls.h: Likewise.
245         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
246         renamed to secondcall and use is negated.
247         (TLS_SETUP_GS_SEGMENT): Likewise.
248         (TLS_INIT_TP): Likewise.
249         * sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
250         secondcall.
252         * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
253         registers.  No need to mask upper 16 bits in this case.
254         * sysdeps/i386/useldt.h: Likewise.
255         (DO_SET_THREAD_AREA): We have to load %gs again even if the value
256         is the same since the GDT content changed.
258         * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
259         to TLS_SETUP_GS_SEGMENT.
260         (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
261         TLS_DO_SET_THREAD_AREA.
262         (TLS_DO_SET_THREAD_AREA): If new parameter is zero determine
263         entry number from %gs value.
264         * sysdeps/sh/tls.h (TLS_INIT_TP): Add new parameter and simply
265         ignore it.
267         * manager.c (pthread_handle_create): Pass NULL to _dl_allocate_tls.
268         Pass true to _dl_deallocate_tls.
269         (pthread_free): Likewise.
270         * pthread.c (__pthread_initialize_manager): Likewise.
272 2002-08-19  Ulrich Drepper  <drepper@redhat.com>
274         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Use correct shift when
275         computing index from %gs value.
277 2002-08-16  Roland McGrath  <roland@redhat.com>
279         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Calculate segment
280         register value from entry number properly.
282         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Rewrite asm to use %ebx
283         optimally conditional on [__PIC__].
284         (TLS_DO_SET_THREAD_AREA): New macro, implement inline syscall
285         without touching errno, and use latest modify_ldt-like interface.
286         (TLS_SETUP_GS_SEGMENT): Use that instead of INLINE_SYSCALL.
287         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Set %gs in this macro.
288         (DO_SET_THREAD_AREA): New macro, uses current syscall interface with
289         existing %gs value as the segment to set.
290         (INIT_THREAD_SELF): Rewritten using those.  Use set_thread_area only
291         under [HAVE_TLS_SUPPORT] so we can rely on the initialization done
292         by the first thread's early TLS setup.
294 2002-08-15  Roland McGrath  <roland@redhat.com>
296         * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
297         return a value as callers now expect.
299 2002-08-11  Roland McGrath  <roland@redhat.com>
301         * pthread.c (__pthread_initialize_manager): Initialize
302         p_header.data.tcb field of manager thread's descriptor.
303         (__pthread_initialize_minimal): Don't initialize p_header.data.self
304         field, already done by TLS_INIT_TP.
306         * manager.c (pthread_handle_create): Move p_header field initializers
307         together.
309 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
311         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
313 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
315         * pthread.c (__linuxthreads_initial_report_events): New variable.
316         (__pthread_initialize_manager): Use it to initialize p_report_events
317         of initial thread.
318         [TLS]: Store pointer to descriptor of manager in __pthread_handles.
320 2002-08-07  Roland McGrath  <roland@redhat.com>
322         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Add an extra argument with
323         an "m" constraint to the asm so the compiler knows LDT_ENTRY was used.
325 2002-08-02  Roland McGrath  <roland@redhat.com>
327         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t):
328         Add _LIBC_TSD_KEY_LOCALE.
329         * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
330         Call __uselocale to initialize our per-thread locale pointer to
331         the global one.
332         * pthread.c (__pthread_initialize_minimal): Likewise.
334         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Add missing \s.
336 2002-08-02  Ulrich Drepper  <drepper@redhat.com>
338         * pthread.c: Declare _errno, _h_errno, and _res unless we use TLS
339         internally.
341         * cancel.c (__pthread_perform_cleanup) [USE_TLS && HAVE___THREAD]:
342         Don't use p_libc_specific element in thread descriptor.
344 2002-07-30  Roland McGrath  <roland@redhat.com>
346         * sysdeps/pthread/bits/libc-tsd.h: Include <tls.h>.
347         [USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
348         which does the right thing when __thread support is available.
349         * descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
350         Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
351         `p_h_errno', `p_resp', and `p_res' members.
352         * pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
353         Don't initialize `p_errnop' and `p_h_errnop' members.
354         (__pthread_reset_main_thread): Likewise.
355         (__pthread_initialize_manager): Likewise.
356         * manager.c (__pthread_manager, pthread_handle_create): Likewise.
357         * pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
358         Don't initialize `p_resp' member.
359         (__pthread_reset_main_thread): Likewise.
360         * manager.c (pthread_handle_create): Likewise.
361         * specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
362         Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
363         * no-tsd.c: Conditionalize contents on [!(USE_TLS && HAVE___THREAD)].
364         * errno.c [USE_TLS && HAVE___THREAD]
365         (__h_errno_location, __res_state): Don't define these at all.
367         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
368         (INSTALL_NEW_DTV, GET_DTV): Likewise.
369         * sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
371         * weaks.c: Don't include <errno.h> here.
373 2002-08-01  Roland McGrath  <roland@redhat.com>
375         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
376         TLS_INIT_TP.
377         (TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
378         (TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
379         (TLS_INIT_TP): Use that.
381 2002-08-02  Jakub Jelinek  <jakub@redhat.com>
383         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Move from INIT_THREAD_SELF.
384         (INIT_THREAD_SELF): Use sys_thread_area syscall instead if available.
385         (FREE_THREAD): Avoid modify_ldt if using GDT.
386         * sysdeps/i386/pspinlock.c (__have_no_set_thread_area): New variable.
388 2002-07-25  Jakub Jelinek  <jakub@redhat.com>
390         * sysdeps/i386/tls.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
391         * sysdeps/i386/pt-machine.h: Likewise.
392         * sysdeps/i386/useldt.h: Likewise.
394 2002-07-22  Ulrich Drepper  <drepper@redhat.com>
396         * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
397         call __libc_setup_tls first.
398         * Makefile: Actually create tst-signal.out file when running the test.
399         (tests): Add tststatic.
400         * Examples/tststatic.c: New file.
402 2002-07-19  Ulrich Drepper  <drepper@redhat.com>
404         * errno.c (__errno_location): Don't define unless !USE_TLS
405         || !HAVE___THREAD.
406         * sysdeps/i386/pt-machine.c: Protect C code with #ifndef ASSEMBLER.
407         * sysdeps/i386/tls.h: Likewise.
408         * sysdeps/i386/useldt.h: Likewise.
409         * sysdeps/i386/i686/pt-machine.h: Likewise.
411 2002-07-02  H.J. Lu  <hjl@gnu.org>
413         * sysdeps/mips/pspinlock.c: Don't include <sgidefs.h>.  Always
414         use ll/sc.
415         * sysdeps/mips/pt-machine.h: Likewise.
417 2002-07-14  Ulrich Drepper  <drepper@redhat.com>
419         * manager.c (pthread_handle_create): Initialize self-reference in
420         descriptor.
422 2002-07-01  Jakub Jelinek  <jakub@redhat.com>
424         * Examples/ex9.c (main): Remove unused th variable.
426 2002-07-10  Ulrich Drepper  <drepper@redhat.com>
428         * wrapsyscall.c: Add __nanosleep alias.
429         * Versions (GLIBC_2.2.6): Add __nanosleep.
430         * bug-sleep.c: New file.
431         * Makefile (tests): Add bug-sleep.
433 2002-06-19  Steven Munroe  <sjmunroe@vnet.ibm.com>
435         * Examples/ex9.c (main):  Use list of children and join them.
436         (thread): Do not call exit.
438 2002-06-20  Ulrich Drepper  <drepper@redhat.com>
440         * spinlock.c (wait_node_alloc): We cannot use compare-and-exchange.
441         Unconditionally use the code using spinlock.  Use __pthread_release
442         to free a spinlock.
443         (wait_node_free): Likewise.
444         (__pthread_acquire, __pthread_release): Unconditionally define.
446 2002-06-07  Jakub Jelinek  <jakub@redhat.com>
448         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Fix typo.
450 2002-05-24  Ulrich Drepper  <drepper@redhat.com>
452         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Use __sync_synchronize.
454 2002-05-21  Ulrich Drepper  <drepper@redhat.com>
456         * sysdeps/pthread/pthread.h (pthread_create): Rename first
457         parameter.
458         (pthread_cancel): Likewise.
459         * internals.h (__pthread_create_2_1): Likewise.
460         * sysdeps/unix/sysv/linux/bits/sigthread.h (pthread_kill): Likewise.
462 2002-05-20  Ulrich Drepper  <drepper@redhat.com>
464         * sysdeps/alpha/pt-machine.c (THREAD_SELF): Remove clobber.
465         Patch by Glen Nakamura <gen@flex.com>.
467 2002-05-03  Ulrich Drepper  <drepper@redhat.com>
469         * signals.c: Move sighandler functions to...
470         * sighandler.c: ...here.  New file.
471         * signals.c: Move signal handler related type definitions to...
472         * internals.h: ...here.  Add prototypes for signal handlers.
473         * Makefile (libpthread-routines): Add sighandler.
474         (CFLAGS-sighandler.c): Add $(exceptions).
476 2002-04-30  Jakub Jelinek  <jakub@redhat.com>
478         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
480 2002-04-08  Ulrich Drepper  <drepper@redhat.com>
482         * sysdeps/pthread/timer_getoverr.c: Return real overrun.
483         * sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
484         * sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
485         based on previous one and not on current time.  Count overruns.
486         Patch by Eric F. Sorton <eric@cctcorp.com>.
488         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
490 2002-04-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
492         * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
493         if it isn't defined yet.
494         (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
495         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
496         Likewise.
497         * sysdeps/sh/tls.h: New file.
499 2002-04-08  Jakub Jelinek  <jakub@redhat.com>
501         * manager.c (__pthread_manager_event): Use self instead of arg
502         for INIT_THREAD_SELF.
503         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct
504         _pthread_descr_struct) instead of sizeof (*descr).
506 2002-04-05  Ulrich Drepper  <drepper@redhat.com>
508         * sysdeps/ia64/pt-machine.h: Protect against multiple inclusion.
509         * sysdeps/alpha/pt-machine.h: Likewise.
510         * sysdeps/arm/pt-machine.h: Likewise.
511         * sysdeps/cris/pt-machine.h: Likewise.
512         * sysdeps/hppa/pt-machine.h: Likewise.
513         * sysdeps/m68k/pt-machine.h: Likewise.
514         * sysdeps/mips/pt-machine.h: Likewise.
515         * sysdeps/powerpc/pt-machine.h: Likewise.
516         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
517         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
518         * sysdeps/sh/pt-machine.h: Likewise.
519         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
520         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
521         * sysdeps/x86_64/pt-machine.h: Likewise.
523 2002-04-05  Jakub Jelinek  <jakub@redhat.com>
525         * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document
526         instead of pthread_mutexattr_setkind_np.
527         (pthread_mutexattr_gettype): Similarly.
528         * man/pthread_mutexattr_setkind_np.man: New.
529         * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man.
531 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
533         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Define.
535 2002-03-22  Jakub Jelinek  <jakub@redhat.com>
537         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Remove.
539 2002-03-22  Ulrich Drepper  <drepper@redhat.com>
541         * internals.h (MEMORY_BARRIER): Define as asm with memory as clobber.
543 2002-03-17  Andreas Jaeger  <aj@suse.de>
545         * sysdeps/i386/pt-machine.h: Add testandset and __compare_and_swap
546         prototpyes.
547         * sysdeps/alpha/pt-machine.h: Likewise.
548         * sysdeps/arm/pt-machine.h: Likewise.
549         * sysdeps/cris/pt-machine.h: Likewise.
550         * sysdeps/hppa/pt-machine.h: Likewise.
551         * sysdeps/i386/i686/pt-machine.h: Likewise.
552         * sysdeps/ia64/pt-machine.h: Likewise.
553         * sysdeps/m68k/pt-machine.h: Likewise.
554         * sysdeps/mips/pt-machine.h: Likewise.
555         * sysdeps/powerpc/pt-machine.h: Likewise.
556         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
557         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
558         * sysdeps/sh/pt-machine.h: Likewise.
559         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
560         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
561         * sysdeps/x86_64/pt-machine.h: Likewise.
563         * internals.h: Move testandset and __compare_and_swap prototypes
564         to pt-machine.h.
566 2002-03-03  Andreas Jaeger  <aj@suse.de>
568         * errno.c: Include resolv.h to avoid warning.
570 2002-02-27  Ulrich Drepper  <drepper@redhat.com>
572         * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
573         stack limit.
575 2002-02-23  Ulrich Drepper  <drepper@redhat.com>
577         * attr.c (pthread_getattr_np): Don't take thread descriptor size
578         into account if USE_TLS.
579         * manager.c (pthread_handle_create): Free TLS data structures if call
580         failed.  Pass correct stack to clone if USE_TLS.
581         * sysdeps/i386/pt-machine.h: Handle multiple inclusion.
582         * sysdeps/i386/i686/pt-machine.h: Likewise.
583         * sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
585         * descr.h (struct _pthread_descr_struct): Update p_header for TLS.
586         Add p_stackaddr element #if USE_TLS.
587         * internals.c: Include <tls.h>.
588         * manager.c: Integrate creating and handling of thread descriptor
589         for TLS.
590         * pthread.c: Likewise.
591         * sysdeps/i386/tls.h (tcbhead_t): Add self pointer.
592         Include <linuxthreads/descr.h> only if TLS is really used.
593         (GET_DTV): New macro.
594         (TLS_INIT_TP): Initialize self pointer.
596 2002-02-17  Andreas Schwab  <schwab@suse.de>
598         * signals.c (sigwait): Check for old sighandler being SIG_ERR,
599         not NULL.
601 2002-02-12  Ulrich Drepper  <drepper@redhat.com>
603         * sysdeps/i386/tls.c (INSTALL_NEW_DTV): Define.
604         (INSTALL_DTV): Adjust for being passed pointer to element with length.
606 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
608         * sysdeps/i386/tls.h (TLS_INIT_TP): Also initialize %gs.
610 2002-02-08  Richard Henderson  <rth@redhat.com>
612         * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string.
614 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
616         * sysdeps/i386/tls.h: TLS cannot be supported with FLOATING_STACKS
617         after all.
619 2002-02-07  H.J. Lu  <hjl@gnu.org>
621         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Silence the
622         gcc warning.
623         (__pthread_spin_lock): Remove ".set noreorder".
624         * sysdeps/mips/pt-machine.h (__compare_and_swap): Liekwise.
626 2002-02-05  H.J. Lu  <hjl@gnu.org>
628         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Not use
629         branch likely.
630         * sysdeps/mips/pt-machine.h (testandset): Likewise.
631         (__compare_and_swap): Likewise.
633 2002-02-07  Ulrich Drepper  <drepper@redhat.com>
635         * internals.h: Move declarations/definitions of
636         __pthread_initial_thread_bos, __pthread_initial_thread,
637         __pthread_manager_thread_bos, __pthread_manager_thread_tos,
638         __pthread_manager_thread, __pthread_nonstandard_stacks, STACK_SIZE,
639         CURRENT_STACK_FRAME, __pthread_find_self, and thread_self...
640         * descr.h: ...here.
641         * sysdeps/i386/tls.h: Add TLS definitions also for !FLOATING_STACKS.
642         Define THREAD_GETMEM accordingly.
644 2002-02-06  Ulrich Drepper  <drepper@redhat.com>
646         * sysdeps/i386/tls.h: Include <stddef.h> for size_t.
648         * sysdeps/i386/tls.h: Define THREAD_DTV.
650 2002-02-04  Ulrich Drepper  <drepper@redhat.com>
652         * internals.h: Move thread descriptor definition...
653         * descr.h.: ...here.  New file.
654         * sysdeps/i386/tls.h: New file.
656 2002-02-01  H.J. Lu  <hjl@gnu.org>
658         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Use a
659         different register in the delayed slot.  Use branch likely.
661         * sysdeps/mips/pt-machine.h (testandset): Call _test_and_set.
662         (__compare_and_swap): Return 0 only when failed to compare. Use
663         branch likely.
665 2002-02-01  Jakub Jelinek  <jakub@redhat.com>
667         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set,
668         __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE.
669         * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE.
670         * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE.
671         * sysdeps/sparc/sparc32/sparcv9/Versions: New file.
672         * sysdeps/sparc/sparc64/Versions: New file.
673         * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE.
675 2002-01-31  Ulrich Drepper  <drepper@redhat.com>
677         * pthread.c: _dl_cpuclock_offset is not any longer a global variable
678         in SHARED code, use GL(dl_cpuclock_offset).
680 2002-01-28  Andreas Jaeger  <aj@suse.de>
682         * sysdeps/mips/pspinlock.c (__pthread_spin_init): Clear *LOCK to
683         0. Patch by Machida Hiroyuki <machida@sm.sony.co.jp>.
685 2002-01-16  Martin Schwidefsky  <schwidefsky@de.ibm.com>
687         * sysdeps/s390/s390-32/pt-machine.h (MEMORY_BARRIER): Define.
688         (CURRENT_STACK_FRAME): Remove duplicate definition.
689         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
691 2002-01-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
693         * Makefile (CFLAGS-tst-cancel.c): Add -fno-inline-functions to prevent
694         automatic inline.
696 2002-01-12  Andreas Schwab  <schwab@suse.de>
698         * Makefile (test-srcs): Add tst-signal.
699         (tests): Run tst-signal.
700         (distribute): Add tst-signal.sh.
701         * tst-signal.c, tst-signal.sh: New files.
703 2002-01-14  Andreas Jaeger  <aj@suse.de>
705         * sysdeps/x86_64/pt-machine.h (INIT_THREAD_SELF): Avoid warning.
707 2002-01-11  Andreas Schwab  <schwab@suse.de>
709         * signals.c (sighandler): Initialize all elements to SIG_ERR.
710         (__sigaction): Don't use value from sighandler if it is SIG_ERR.
712 2002-01-06  Richard Henderson  <rth@redhat.com>
714         * sysdeps/alpha/elf/pt-initfini.c: New file.
716 2001-12-29  Andreas Jaeger  <aj@suse.de>
718         * Examples/ex9.c: Add noreturn attribute for thread.
719         * Examples/ex10.c: Likewise.
720         * Examples/ex13.c (thread_start): Likewise.
721         * Examples/ex15.c (worker): Likewise.
723         * Examples/ex18.c: Include unistd.h for prototype of sleep.
725 2001-12-14  Ulrich Drepper  <drepper@redhat.com>
727         * man/pthread_atfork.man: Adjust description of mutex handling
728         after fork for current implementation.
729         * linuxthreads.texi: Likewise [PR libc/2519].
731 2001-12-13  Andreas Schwab  <schwab@suse.de>
733         * specific.c (pthread_key_delete): Don't contact the thread
734         manager if no threads have been created yet.
736 2001-12-12  NIIBE Yutaka  <gniibe@m17n.org>
738         * sysdeps/sh/pt-machine.h (INIT_THREAD_SELF): Added __volatile__
739         qualifier to be safe.
741 2001-11-30  Andreas Schwab  <schwab@suse.de>
743         * pthread.c (pthread_handle_sigcancel) [THREAD_SELF]: Double check
744         that self is the manager thread, and initialize the thread
745         register if not.
746         (thread_self_stack) [THREAD_SELF]: New function to find self via
747         stack pointer.
748         * manager.c (pthread_handle_create): Don't block cancel signal any
749         more.
751 2001-11-29  Andreas Jaeger  <aj@suse.de>
753         * sysdeps/x86_64/pt-machine.h: Use %gs as thread specific register.
754         (THREAD_SELF): New.
755         (INIT_THREAD_SELF): New.
756         (THREAD_GETMEM): New.
757         (THREAD_GETMEM_NC):
758         (THREAD_SETMEM): New.
759         (THREAD_SETMEM_NC): New.
760         (FLOATING_STACKS): Define.
761         (ARCH_STACK_MAX_SIZE): Define.
763 2001-11-28  Kaz Kylheku  <kaz@ashi.footprints.net>
765         Bugfix to pthread_key_delete. It was iterating over the thread
766         manager's linked list of threads, behind the thread manager's
767         back causing a race. The fix is to have the manager iterate over
768         the threads instead, using a new request type for doing so.
769         * internals.h (struct pthread_request): New manager request type
770         REQ_FOR_EACH_THREAD.
771         * manager.c (pthread_for_each_thread): New function.
772         (__pthread_manager): Handle new REQ_FOR_EACH_THREAD request.
773         * specific.c (struct pthread_key_delete_helper_args): New type.
774         (pthread_key_delete_helper): New static function.
775         (pthread_key_delete): Use the new thread manager
776         REQ_FOR_EACH_THREAD function to iterate over the threads and set
777         the delete key slot to a null value in each thread.
778         * Examples/ex18.c: New test.
779         * Makefile (tests): Add ex18.
781 2001-11-22  Wolfram Gloger  <wg@malloc.de>
783         * pthread.c (pthread_onexit_process): Don't call free
784         after threads have been asynchronously terminated.
786         * manager.c (pthread_handle_exit): Surround cancellation
787         of threads with __flockfilelist()/__funlockfilelist().
789 2001-11-26  Andreas Schwab  <schwab@suse.de>
791         * manager.c (pthread_handle_create): Start the child thread with
792         the cancel signal blocked, so that it does not handle it before
793         the thread register is set up.  Save errno from failed clone call.
795 2001-11-15  Ulrich Drepper  <drepper@redhat.com>
797         * sysdeps/i386/i686/Implies: Removed.
798         * sysdeps/i386/i686/Versions: New file.
800 2001-10-31  Andreas Jaeger  <aj@suse.de>
802         * sysdeps/x86_64/Makefile: Remove, we do not need it anymore.
804 2001-10-05  Kevin Buettner  <kevinb@cygnus.com>
806         * pthread.c (__linuxthread_pthread_sizeof_descr): Change name
807         to __linuxthreads_pthread_sizeof_descr to match name used by
808         symbol_list_arr[LINUXTHREADS_PTHREAD_SIZEOF_DESCR] in
809         linuxthreads_db/td_symbol_list.c.
811 2001-09-22  Andreas Jaeger  <aj@suse.de>
813         * linuxthreads/tst-context.c: Avoid compile warning.
815 2001-09-20  Andreas Jaeger  <aj@suse.de>
817         * shlib-versions: Add x86-64.
819 2001-09-19  Andreas Jaeger  <aj@suse.de>
821         * sysdeps/x86_64/Makefile: New file.
822         * sysdeps/x86_64/pspinlock.c: New file.
823         * sysdeps/x86_64/pt-machine.h: New file.
825 2001-09-12  Jakub Jelinek  <jakub@redhat.com>
827         * sysdeps/pthread/timer_delete.c (timer_delete): Thread may be NULL
828         for SIGEV_NONE.
829         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
831 2001-09-11  Ulrich Drepper  <drepper@redhat.com>
832             Wolfram Gloger <wg@malloc.de>
834         * join.c: Protect all communications from and to manager with
835         TEMP_FAILURE_RETRY.
836         * manager.c: Likewise.
837         * pthread.c: Likewise.
838         * smeaphore.c: Likewise.
840 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
842         * spinlock.c (__pthread_lock): Top max_count value with
843         MAX_ADAPTIVE_SPIN_COUNT.
844         * internals.h (MAX_ADAPTIVE_SPIN_COUNT): Define if not already done.
846         * sysdeps/i386/i686/pt-machine.h (BUSY_WAIT_NOP): New macro to
847         help P4.
849 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
851         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
852         non-opaque type if __USE_UNIX98.
854 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
856         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
857         non-opaque lock types also if _IO_MTSAFE_IO is defined.
859 2001-08-23  Roland McGrath  <roland@frob.com>
861         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start): Take
862         new first argument, skip the cleanup handler if it's zero.
863         (_LIBC_LOCK_RECURSIVE_INITIALIZER): New macro.
864         (__libc_lock_define_initialized_recursive): Use it.
865         * sysdeps/pthread/bits/stdio-lock.h: File removed.
866         The sysdeps/generic file from the main tree now suffices.
868 2001-08-22  Roland McGrath  <roland@frob.com>
870         * sysdeps/pthread/bits/stdio-lock.h: Include <bits/libc-lock.h>
871         instead of <pthread.h>.
872         (_IO_lock_t): Define this typedef using __libc_lock_define_recursive.
873         (_IO_lock_initializer): Add braces.
874         (_IO_lock_lock): Use __libc_lock_lock_recursive.
875         (_IO_lock_unlock): Use __libc_lock_unlock_recursive.
877         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_recursive_t): New type.
878         (__libc_lock_define_initialized_recursive): Use it.
879         (__libc_lock_init_recursive): Likewise.
880         (__libc_lock_fini_recursive): Likewise.
881         (__libc_lock_lock_recursive): Likewise.
882         (__libc_lock_trylock_recursive): Likewise.
883         (__libc_lock_unlock_recursive): Likewise.
884         (__libc_lock_define_recursive): New macro.
886 2001-08-14  Jakub Jelinek  <jakub@redhat.com>
888         * lockfile.c (__pthread_provide_lockfile): New variable.
889         * pthread.c (__pthread_require_lockfile): New variable.
890         * cancel.c (__pthread_require_lockfile): New variable.
892 2001-07-31  Ulrich Drepper  <drepper@redhat.com>
894         * tst-context.c (threadfct): Initialize context before calling
895         makecontext.
897         * Examples/ex17.c: Make sure test thread is around long enough.
899 2001-07-26  kaz Kojima  <kkojima@rr.iij4u.or.jp>
901         * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
903 2001-07-24  Ulrich Drepper  <drepper@redhat.com>
905         * tst-context.c (main): Print explanation before bailing out
906         because context handling is not supported.
908 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
910         * Makefile (tests): Add tst-context.
911         * tst-context.c: New file.
913         * sysdeps/pthread/bits/stdio-lock.h: Define
914         _IO_cleanup_region_start_noarg.
916 2001-07-23  Jakub Jelinek  <jakub@redhat.com>
918         * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
919         (ARCH_STACK_MAX_SIZE): Define.
920         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
921         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
923 2001-07-19  Jakub Jelinek  <jakub@redhat.com>
925         * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
927         * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
928         (ARCH_STACK_MAX_SIZE): Define.
929         * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
930         NEED_SEPARATE_REGISTER_STACK.
932 2001-07-16  Andreas Schwab  <schwab@suse.de>
934         * Makefile (before-compile): Don't add $(objpfx)crti.o.
935         (omit-deps): Add crti.
936         ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
937         it is filtered out of the link command.
939 2001-07-16  Ulrich Drepper  <drepper@redhat.com>
941         * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
942         to find the right value for __pthread_initial_thread_bos, it's not
943         used.  If not FLOATING_STACKS first run
944         __pthread_init_max_stacksize.
946 2001-06-16  H.J. Lu  <hjl@gnu.org>
948         * internals.h: Include <stackinfo.h>.
950         * attr.c: Don't include <stackinfo.h> here.
951         * cancel.c: Likewise.
952         * manager.c: Likewise.
953         * pthread.c: Likewise.
954         * ptlongjmp.c: Likewise.
956 2001-03-23  Matthew Wilcox  <willy@ldl.fc.hp.com>
958         * attr.c: Make _STACK_GROWS_UP work.
959         * internals.h: Likewise.
960         * manager.c: Likewise.
961         * pthread.c: Likewise.
963 2001-06-15  H.J. Lu  <hjl@gnu.org>
965         * pthread.c (__pthread_reset_main_thread): Fix a typo.
967 2001-02-02  John S. Marvin  <jsm@udlkern.fc.hp.com>
969         * semaphore.h: Use struct _pthread_fastlock as an element of
970         sem_t instead of an identical struct.
971         * rwlock.c: Remove casts.
972         * semaphore.c: Likewise.
974 2001-04-30  Alan Modra  <amodra@one.net.au>
976         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
978 2001-05-25  Bruce Mitchener  <bruce@cubik.org>
980         * linuxthreads.texi: Spelling corrections.
982 2001-05-25  Ulrich Drepper  <drepper@redhat.com>
984         * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
985         returning successfully.
986         Patch by Gene Cooperman <gene@ccs.neu.edu>.
988 2001-05-24  Ulrich Drepper  <drepper@redhat.com>
990         * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
991         serious work try once whether the lock is uncontested.
992         Remove duplicate reading of __status before loop.
993         Change suggested by Hans Boehm <hans_boehm@hp.com>.
995         * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
996         (__pthread_alt_trylock): Likewise.
998 2001-05-01  Kaz Kylheku  <kaz@ashi.footprints.net>
1000         Memory barrier overhaul following line by line inspection.
1001         * mutex.c (pthread_once): Missing memory barriers added.
1002         * pthread.c (__pthread_wait_for_restart_signal,
1003         __pthread_timedsuspend_new, __pthread_restart_new): Added
1004         memory barriers ``just in case'' and for documentary value.
1005         * spinlock.c (__pthread_release): New inline function for releasing
1006         spinlock, to complement __pthread_acquire.  Includes memory
1007         barrier prior to assignment to spinlock, and __asm __volatile
1008         dance to prevent reordering or optimization of the spinlock access.
1009         * spinlock.c (__pthread_unlock, __pthread_alt_lock,
1010         __pthread_alt_timedlock, __pthread_alt_unlock,
1011         __pthread_compare_and_swap): Updated to use new __pthread_release
1012         instead of updating spinlock directly.
1013         * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
1014         wait_node_free, wait_node_dequeue, __pthread_alt_lock,
1015         __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
1016         Memory barrier overhaul.  Lots of missing memory barriers added,
1017         a couple needless ones removed.
1018         * spinlock.c (__pthread_compare_and_swap): testandset optimization
1019         removed, just calls __pthread_acquire, which has the new read
1020         barrier in it before its testandset.
1022 2001-05-20  Roland McGrath  <roland@frob.com>
1024         * Makeconfig: New file, variables used to be in main libc Makeconfig.
1026 2001-05-09  Geoff Keating  <geoffk@redhat.com>
1028         * sysdeps/powerpc/pt-machine.h
1029         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
1030         (__compare_and_swap): Remove memory barriers.
1031         (__compare_and_swap_with_release_semantics): New function.
1033 2001-04-24  Andreas Jaeger  <aj@suse.de>
1035         * wrapsyscall.c: send* and recv* return ssize_t.
1037         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
1038         mutex instead of double locking it.
1039         Reported by Pierre Artaud <partaud@sodatec.com>.
1041 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
1043         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
1044         using #ifdef whether the clock is available.
1045         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
1047         * sysdeps/ia64/Versions: New file.
1049         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
1050         have to call __gmon_start__ in the libpthread DSO.
1051         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
1053         * Makefile (libpthread-routines): Add ptclock_gettime and
1054         ptclock_settime.
1055         * internals.h: Don't use cpuclock-init.h definitions, use
1056         hp-timing.h definitions.
1057         * pthread.c: Likewise.
1058         * manager.c: Likewise.
1059         * ptclock_gettime.c: New file.
1060         * ptclock_settime.c: New file.
1061         * internals.h: Fix parameter type for __pthread_clock_gettime and
1062         __pthread_clock_settime.
1064         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
1065         * sysdeps/i386/i586/ptclock_settime.c: Removed.
1066         * sysdeps/i386/i586/Makefile: Removed.
1068 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
1070         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
1071         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1073 2001-04-21  Andreas Jaeger  <aj@suse.de>
1075         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
1076         attribute, remove statements that will never be executed.
1077         (thread_func): Remove mutex_unlock call since it's never executed.
1078         (thread_func): Fix comment as suggested by Jakub Jelinek.
1080         * manager.c (__pthread_manager): Add noreturn
1081         attribute.
1082         (pthread_start_thread): Likewise, remove return statement.
1083         (pthread_start_thread_event): Likewise.
1084         Add noreturn attribute for pthread_handle_exit.
1085         * weaks.c: Add noreturn attribute for pthread_exit.
1087         * internals.h: Add __pthread_clock_gettime and
1088         __pthread_clock_settime prototypes.
1090 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
1092         * internals.h: Include <cpuclock-init.h>.
1093         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
1094         CPUCLOCK_VARDEF is defined.
1095         * pthread.c (__pthread_initialize_minimal): Initialize
1096         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
1097         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
1098         for new thread to current CPU clock value.
1100         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
1102         * sysdeps/i386/i586/Makefile: New file.
1103         * sysdeps/i386/i586/Versions: New file.
1104         * sysdeps/i386/i586/ptclock_gettime.c: New file.
1105         * sysdeps/i386/i586/ptclock_settime.c: New file.
1106         * sysdeps/i386/i686/Implies: New file.
1108 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1110         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
1111         $generated, not $postclean-generated.
1113 2001-04-18  Andreas Jaeger  <aj@suse.de>
1115         * Makefile (otherlibs): Added.
1117 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1119         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1121 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
1123         * signals.c (sigwait): NSIG is no signal number.  Block all
1124         signals while in signal handler for signals in SET.
1125         Patch by Manfred Spraul <manfred@colorfullife.com>.
1127 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
1129         * tst-cancel.c: Disable most tests.  Add new test where all
1130         cleanup handlers must run.
1131         * Makefile (tests): Add tst-cancel again.
1133         * cancel.c (__pthread_perform_cleanup): Correct condition for
1134         leaving cleanup loop early.
1136         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
1137         all the files which use CURRENT_STACK_FRAME.
1138         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
1139         __builtin_frame_address.
1140         * sysdeps/i386/i686/pt-machine.h: Likewise.
1142 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1144         * Makefile (tests): Comment out tst-cancel for now.
1146         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
1147         temporary file in object directory.
1148         * Makefile: Don't allow inlining when compiling tst-cancel.c.
1149         Pass $(objpfx) to tst-cancel.
1151 2001-04-11  David S. Miller  <davem@redhat.com>
1153         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
1154         up closer to user local variables so that new cleanup heuristics work.
1155         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
1157 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1159         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
1160         and remove it.
1161         (_pthread_cleanup_push_defer): Likewise.
1163         * tst-cancel.c (main): Fix loop printing cleanup output.
1165 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1167         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
1168         test.
1169         (__pthread_spin_trylock): Likewise.
1170         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1172 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
1174         * join.c (pthread_exit): Move code to new function __pthread_do_exit
1175         which takes an extra parameter with the current frame pointer.
1176         Call new function with CURRENT_STACK_FRAME.
1177         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
1178         with the new parameter.
1179         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
1180         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
1181         this parameter as the initial value the cleanup handler records are
1182         compared against.  No active cleanup handler record must have an
1183         address lower than the previous one and the initial record must be
1184         above (below on PA) the frame address passed in.
1185         (pthread_setcancelstate): Call __pthread_do_exit instead of
1186         pthread_exit.
1187         (pthread_setcanceltype): Likewise.
1188         (pthread_testcancel): Likewise.
1189         (_pthread_cleanup_pop_restore): Likewise.
1190         * condvar.c (pthread_cond_wait): Likewise.
1191         (pthread_cond_timedwait_relative): Likewise.
1192         * manager.c (pthread_start_thread): Likewise.
1193         * oldsemaphore.c (__old_sem_wait): Likewise.
1194         * pthread.c (pthread_handle_sigcancel): Likewise.
1195         * semaphore.c (__new_sem_wait): Likewise.
1196         (sem_timedwait): Likewise.
1197         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
1198         to limit the cleanup handlers which get run.
1199         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
1200         for __pthread_perform_cleanup.
1202         * Makefile (tests): Add tst-cancel.
1203         * tst-cancel.c: New file.
1205 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
1207         * sysdeps/cris/pt-machine.h: New file.
1208         * sysdeps/cris/pspinlock.c: New file.
1210 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
1212         * shlib-versions: Add case for Linux on CRIS.
1214 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
1216         * attr.c (pthread_getattr_np): Correct computation of stack size
1217         for machiens with register stack.
1219         * Examples/ex17.c (main): Correct detection of failed mmap call.
1221 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1223         * pthread.c (__pthread_initialize_manager): Fix a typo.
1225 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1227         * attr.c (__pthread_attr_setstack): Fix alignment check.
1228         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
1229         * Makefile (tests): Add ex17 test.
1230         * Examples/ex17.c: New test.
1232 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
1234         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
1235         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
1236         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
1238 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
1240         * Makefile: When generating DSO link with libc_nonshared.a.
1242 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
1244         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
1246 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
1248         * internals.h (__pthread_init_max_stacksize): New prototype.
1249         * attr.c (__pthread_attr_setstacksize): Call
1250         __pthread_init_max_stacksize if not yet initialized.
1251         * pthread.c (__pthread_init_max_stacksize): New function.
1252         (__pthread_initialize_manager): Call it.
1253         Patch by <dtc@cmucl.cons.org>.
1255 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
1257         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
1259 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1261         * shlib-versions: Add rule for Linux on 64 bit S/390.
1262         * sysdeps/s390/s390-64/pt-machine.h: New file.
1263         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
1265 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1267         * sysdeps/s390/pt-machine.h: Move to...
1268         * sysdeps/s390/s390-32/pt-machine.h: ...here.
1269         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
1271 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
1273         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
1274         * attr.c: Implement pthread_getattr_np.
1275         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
1276         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
1277         * manager.c (pthread_handle_create): Initialize p_inheritsched.
1279 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1281         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
1282         code alignment.
1284 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
1286         * manager.c (manager_mask): Removed static vesion.  Now always local
1287         to __pthread_manager().
1288         (manager_mask_all): Removed completely.
1289         (__pthread_manager): Remove manager_mask_all initialization.
1290         (pthread_handle_create): Remove code to set and reset signal mask
1291         around __clone2() calls.
1293 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
1295         * spinlock.c (__pthread_lock): Force lock->__status to be read from
1296         memory on every spin.
1298 2001-02-10  Andreas Jaeger  <aj@suse.de>
1300         * Makefile (extra-objs): New.
1302 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
1304         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
1305         __pthread_initialize_minimal prototype.
1307 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1309         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
1311 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1313         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
1315 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
1317         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
1318         broken code.  Patch by Jes Sorensen.
1320 2001-02-06  Andreas Jaeger  <aj@suse.de>
1322         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
1323         to...
1324         * internals.h: ...here.
1326 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
1328         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1330 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
1332         * Versions: Remove __pthread_initialize_minimal.
1334 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
1336         * Makefile: Add rules to build crti.o and make it being used in
1337         building libpthread.so.
1338         * sysdeps/i386/Makefile: New file.
1339         * sysdeps/pthread/pt-initfini.c: New file.
1341         * pthread.c: Cleanups.
1343 2001-01-28  Andreas Jaeger  <aj@suse.de>
1345         * oldsemaphore.c (__old_sem_init): Adjust for last change.
1346         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1347         * spinlock.c: Likewise.
1349 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
1351         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
1352         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
1353         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
1354         * pthread.c: Likewise.
1355         * spinlock.h: Likewise.
1356         * sysdeps/pthread/pthread.h: Likewise.
1358 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
1360         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
1361         as struct __pthread_attr_s.
1363         * semaphore.h (sem_t): Cleanup namespace, rename status and
1364         spinlock elements.
1366 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
1368         * pthread.c (pthread_onexit_process): Clear
1369         __pthread_manager_thread_bos after freeing it.
1370         * Makefile (tests): Add ex16.
1371         * Examples/ex16.c: New file.
1373 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1375         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
1376         -z nodelete.
1377         * pthread.c (pthread_exit_process): Rename to...
1378         (pthread_onexit_process): ...this.
1379         (pthread_atexit_process, pthread_atexit_retcode): New.
1380         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
1381         and only if HAVE_Z_NODELETE is not defined.
1382         (__pthread_initialize_manager): Register pthread_atexit_retcode
1383         with __cxa_atexit.
1385 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
1387         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
1389 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1391         * Makefile (tests): Add ex15.
1392         * Examples/ex15.c: New test.
1394 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
1396         * pthread.c (pthread_exit_process): Free memory allocated for
1397         manager stack.
1399 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1401         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
1402         (pthread_free): Always unmap the stack.  It's safe now that we don't
1403         use MAP_FIXED to allocate stacks.
1405 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1407         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
1409         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
1411 2000-11-15  Wolfram Gloger  <wg@malloc.de>
1413         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
1414         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
1416 2000-12-27  Andreas Jaeger  <aj@suse.de>
1418         * Examples/ex13.c: Make local functions static.
1419         * ecmutex.c: Likewise.
1420         * joinrace.c: Likewise.
1421         * Examples/ex14.c: Likewise.
1423         * Examples/ex2.c: Make local functions static; reformat.
1424         * Examples/ex1.c: Likewise.
1425         * Examples/ex4.c: Likewise.
1426         * Examples/ex5.c: Likewise.
1427         * Examples/ex7.c: Likewise.
1429         * oldsemaphore.c: Add prototypes to shut up GCC.
1430         * pt-machine.c: Likewise.
1432         * weaks.c: Add prototype for pthread_exit.
1434         * internals.h: Add some prototypes, format prototypes and add
1435         missing externs.
1436         Move __libc_waitpid prototype to include/sys/wait.h.
1438         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
1439         * mutex.c: Likewise.
1440         * specific.c: Likewise.
1441         * ptfork.c: Likewise.
1443         * lockfile.c: Include internals.h to get prototypes.
1444         * events.c: Likewise.
1445         * sysdeps/alpha/pspinlock.c: Likewise.
1446         * sysdeps/arm/pspinlock.c: Likewise.
1447         * sysdeps/hppa/pspinlock.c: Likewise.
1448         * sysdeps/i386/pspinlock.c: Likewise.
1449         * sysdeps/ia64/pspinlock.c: Likewise.
1450         * sysdeps/m68k/pspinlock.c: Likewise.
1451         * sysdeps/mips/pspinlock.c: Likewise.
1452         * sysdeps/powerpc/pspinlock.c: Likewise.
1453         * sysdeps/s390/pspinlock.c: Likewise.
1454         * sysdeps/sh/pspinlock.c: Likewise.
1455         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
1456         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
1457         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
1459 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
1461         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
1462         (__pthread_attr_getstack): Return correct address.
1463         Add warnings for using pthread_attr_getstackaddr and
1464         pthread_attr_setstackaddr.
1466 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
1468         * Examples/ex6.c (test_thread): Make static.
1469         * Examples/ex12.c (test_thread): Make static and add noreturn
1470         attribute.
1472 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
1474         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
1475         and compare_and_swap_with_release_semantics returns int not long.
1477 2000-12-17  Andreas Jaeger  <aj@suse.de>
1479         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
1480         value.
1481         * sysdeps/arm/pt-machine.h (testandset): Likewise.
1482         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
1483         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
1484         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1485         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
1486         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
1488 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
1490         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
1491         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
1493 2000-12-17  Andreas Jaeger  <aj@suse.de>
1495         * internals.h: Add prototypes for testandset and
1496         __compare_and_swap to shut up gcc warnings.
1498 2000-12-06  Wolfram Gloger  <wg@malloc.de>
1500         * join.c (pthread_detach): Allow case where the thread has already
1501         terminated.
1503 2000-12-05  Andreas Jaeger  <aj@suse.de>
1505         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
1506         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1507         (__compare_and_swap): Likewise.
1508         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
1510 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
1512         * Examples/ex3.c (main): Cast int to long before casting to void *.
1513         (search): Cast void * to long, not int.
1514         * Examples/ex8.c (main, thread): Similarly.
1515         * Examples/ex11.c (main): Similarly.
1516         * Examples/ex14.c (worker, do_test): Similarly.
1517         * ecmutex.c (worker, do_test): Similarly.
1518         (nlocks): Cast to int.
1520 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
1522         * linuxthreads.texi:  Add documentation for pthreads attributes
1523         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
1524         patch.  Document pthread_[sg]etconcurrency().  Mark
1525         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
1527 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
1529         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1530         Don't define it.
1531         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1532         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
1534 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
1536         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
1537         not doing it right now.
1538         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
1540 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
1542         * Examples/ex4.c (main): Don't use exit() to avoid warning with
1543         broken compilers.
1545 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
1547         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
1548         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
1550         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
1551         discussing mutexes. (As per the Unix98 name for the API.)
1552         Changes documentation for pthread_mutexattr_setkind_np() and
1553         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
1554         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
1555         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
1556         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
1557         Begins to introduce discussion of the ``timed'' mutex type.  This
1558         discussion is currently incomplete.
1559         Patch by Bruce Mitchener <bruce@cubik.org>.
1561 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
1562             Yutaka Niibe  <gniibe@chroot.org>
1564         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
1565         has restrictions, use register.
1567 2000-10-23  Andreas Schwab  <schwab@suse.de>
1569         * Examples/ex14.c (TIMEOUT): Override default timeout.
1571 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
1573         * specific.c: Protect tsd array modification in thread data
1574         structures by getting the thread lock in pthread_key_delete and
1575         __pthread_destroy_specifics.
1576         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
1578 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1580         * sysdeps/pthread/bits/initspin.h: New file.
1581         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
1582         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
1583         (__pthread_alt_init_lock): Likewise.
1584         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
1586 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
1588         * oldsemaphore.c (__old_sem_init): Release lock with
1589         LT_SPINLOCK_INIT, not zero.
1590         * spinlock.c (__pthread_unlock): Likewise.
1591         (__pthread_alt_lock): Likewise.
1592         (__pthread_alt_timedlock): Likewise.
1593         (__pthread_alt_unlock): Likewise.
1594         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
1595         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
1596         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
1597         LT_SPINLOCK_INIT do initialize spinlocks not 0.
1599 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
1601         * shlib-versions: Add version definitions for hppa-linux.
1603 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1605         * sysdeps/hppa/pspinlock.c: New file.
1606         * sysdeps/hppa/pt-machine.h: New file.
1607         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
1609 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
1611         * mutex.c (__pthread_mutex_destroy): Correct test of
1612         busy mutex for mutexes using alternate fastlocks.
1613         Patch by dtc@cmucl.cons.org.
1615 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
1617         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
1619 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
1621         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
1622         test for owner first.
1623         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1625         * cancel.c (pthread_cancel): Don't do anything if cancelation is
1626         disabled.
1628 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
1630         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
1631         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1633         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
1634         _POSIX_MONOTONIC_CLOCK.
1636         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
1637         and explain why.
1639 2000-09-20  Andreas Jaeger  <aj@suse.de>
1641         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
1642         "testrtsig.h" conditional.
1644 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
1646         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
1647         pthread_attr_setstack.
1648         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
1649         pthread_attr_setstack.
1650         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
1652 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
1654         * Examples/ex14.c: New file.
1655         * Makefile (tests): Add ex14.
1657         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
1658         mutex.  Patch by dtc@cmucl.cons.org.
1660         * ecmutex.c: New file.
1661         * Makefile (tests): Add ecmutex.
1663 2000-09-04  H.J. Lu  <hjl@gnu.org>
1665         * attr.c (__pthread_attr_setguardsize): Use page_roundup
1666         instead of roundup to round up to the page size.
1668 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
1670         * manager.c (pthread_exited): Correctly report event as TD_REAP
1671         instead of TD_DEATH.  Fix comments.
1673 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
1675         * spinlock.h (testandset): Add cast to avoid warning.
1676         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1678 2000-09-02  Andreas Jaeger  <aj@suse.de>
1680         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
1681         prototype.
1683 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
1685         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1686         Fix typo in last patch (_mode -> _flags).
1688         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1689         Provide definition which respects _IO_USER_LOCK flag.
1691 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
1693         * manager.c (pthread_allocate_stack): Clear descriptor only if not
1694         mmaped.
1696 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
1698         * Makefile: Add rules to build and run unload.
1699         * unload.c: New file.
1701         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
1703         * sysdeps/pthread/pthread.h
1704         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
1705         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
1707 2000-08-24  Andreas Jaeger  <aj@suse.de>
1709         * Examples/ex13.c: Include <string.h> for strerror prototype and
1710         <stdlib.h> for abort prototype.
1711         (pthr_cond_signal_mutex): Rewrite to silence GCC.
1712         (thread_start): Remove unused variable err.
1713         (main): Silence GCC warnings.
1715 2000-08-22  Andreas Jaeger  <aj@suse.de>
1717         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
1719         * Makefile (tests): Add ex13.
1721 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
1723         * semaphore.h: Add restrict where required by AGd4.
1724         * sysdeps/pthread/pthread.h: Likewise.
1725         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
1727 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
1729         * Makefile (tests): Add ex12.  Add rule to build it.
1730         * Examples/ex12.c: New file.
1732 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
1734         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
1735         even though the implementation is not quite complete (but it reports
1736         it).  Define _POSIX_MESSAGE_PASSING to -1.
1737         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1739 2000-08-12  Andreas Jaeger  <aj@suse.de>
1741         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
1742         assembler.
1743         (__compare_and_swap): Likewise.
1744         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
1746 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
1748         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
1749         p_h_errnop correctly and not to NULL.
1751 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
1753         * Banner: Bump version number to 0.9.
1755 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
1757         * Makefile (tests): Add tststack.  Add rule to build the program.
1758         * tststack.c: New file.
1760         * internals.h: Declare __pthread_max_stacksize.
1761         * pthread.c (__pthread_max_stacksize): New variable.
1762         (__pthread_initialize_manager): Determine __pthread_initialize_manager
1763         value.
1764         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
1765         (pthread_allocate_stack): Allow kernel to choose stack address if
1766         FLOATING_STACKS.  This also handles variable-sized stacks.
1767         Always allocate stack and guardpage together.  Use mprotect to
1768         change guardpage access.
1769         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
1770         ARCH_STACK_MAX_SIZE.
1772         * attr.c (__pthread_attr_setstacksize): Also test value against
1773         upper limit.
1775         * manager.c (__pthread_nonstandard_stacks): Define only if
1776         THREAD_SELF is not defined.
1777         (pthread_allocate_stack): Always initialize gardaddr to a correct
1778         value.
1779         (pthread_handle_create): Unmap thread with one call.
1780         (pthread_free): Remove test for initial thread before removing stack.
1781         Unmap stack with one call.
1783         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
1784         1 to avoid removing the stack.
1786 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
1788         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
1789         load of spin lock to prime the cache before the atomic compare and
1790         exchange operation (cmpxchg4). This avoids the spinning on the
1791         cmpxchg4 instruction and reduces movement of the cache line back
1792         and forth between the processors (explanation by Asis K. Mallick
1793         from Intel). This basically makes the implementation operate the
1794         same as the Linux kernel implementation.
1796         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
1797         * sysdeps/ia64/pspinlock.c: New file.
1799 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
1801         * pthread.c: Move definition of __pthread_set_own_extricate_if...
1802         * spinlock.h: ...here.  Remove locking.
1803         * internals.h: Remove __pthread_set_own_extricate_if prototype.
1805         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
1806         (rwlock_rd_extricate_func): Don't determine self, let
1807         __pthread_lock do it.
1808         (rwlock_wr_extricate_func): Likewise.
1809         (rwlock_have_already): Optimize *pself handling a bit.
1811         * mutex.c: Use __builtin_expect.
1812         * pthread.c: Likewise.
1814 2000-08-02  Andreas Jaeger  <aj@suse.de>
1816         * sysdeps/s390/pspinlock.c: New file.
1817         * sysdeps/s390/pt-machine.h: New file.
1818         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
1820 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1822         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
1823         R3K.
1824         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1826 2000-07-26  Andreas Jaeger  <aj@suse.de>
1828         * pthread.c: Initialize p_sem_avail.
1830 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
1832         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
1833         * semaphore.c: Handle spurious wakeups.
1835         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
1836         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
1838         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
1839         (__pthread_wait_for_restart): Likewise.
1841         * condvar.c (pthread_cond_wait): Also check whether thread is
1842         cancelable before aborting loop.
1843         (pthread_cond_timedwait): Likewise.
1845         * signals.c (pthread_sighandler): Remove special code to restrore
1846         %gs on x86.
1847         (pthread_sighandler_t): Likewise.
1849 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
1851         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
1852         * pthread.c: Include <resolv.h>.
1853         (_res): Undefine.  Add extern declaration.
1855 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
1857         * pthread.c (__pthread_initial_thread): Update initializer.
1858         (__pthread_manager_thread): Likewise.
1859         (pthread_initialize): Move setrlimit call to...
1860         (__pthread_initialize_manager): ...here.
1861         (__pthread_reset_main_thread): Reset also soft limit on stack size.
1863         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
1864         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
1866 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
1868         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
1869         __compare_and_swap to define testandset.
1870         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
1871         Define IMPLEMENT_TAS_WITH_CAS.
1873 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
1875         * Makefile: Pass -z nodelete to linker for libpthread.so
1876         generation if it understand this option.
1878 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
1880         * manager.c (pthread_handle_create): Remove initialization of
1881         new_thread->p_res._sock.
1883 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
1885         Bugfixes to the variant of the code for machines with no compare
1886         and swap.
1888         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
1889         node was not being properly enqueued, due to failing to update
1890         the lock->__status field.
1892         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
1893         being set inappropriately, causing the suspend function to be called
1894         with a null self pointer and crash.
1896 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
1898         * spinlock.h (__pthread_alt_trylock): Fix code used if no
1899         compare&swap is available.
1901         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
1902         compare_and_swap.
1904         * pthread.c (pthread_initialize): Don't use sysconf to determine
1905         whether the machine has more than one processor.
1907         * spinlock.c (__pthread_alt_timedlock): Add back one of the
1908         removed thread_self calls.
1910 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1912         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
1913         __compare_and_swap to compare_and_swap in code which assumes
1914         compare swap is available.
1916 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1918         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
1919         bug whereby thr field of waitnode structure would not be correctly
1920         set unless a null self pointer is passed to the functions.
1921         Eliminated redundant calls to thread_self().
1923 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
1925         * pthread.c (__pthread_initialize_manager): Lock
1926         __pthread_manager_thread.p_lock before calling clone.
1928 2000-05-05  H.J. Lu  <hjl@gnu.org>
1930         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1931         have acquire semantics.
1932         (__compare_and_swap_with_release_semantics): New inline
1933         function.
1934         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1936 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
1938         * manager.c: Fix the problem with signals at startup.
1939         Change the way that thread stacks are allocated on IA64.
1940         Clean up some of the guard page allocation stuff.
1942 1999-12-19  H.J. Lu  <hjl@gnu.org>
1944         * internals.h (page_roundup): New.
1945         * attr.c (__pthread_attr_setguardsize); Use page_roundup
1946         instead of roundup.
1947         * manager.c (pthread_allocate_stack): Make sure guardaddr is
1948         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1949         is define.
1951 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
1953         * manager.c (pthread_allocate_stack): Unmap the stack top
1954         if failed to map the stack bottom.
1955         Fix the guard page.
1956         (pthread_free): Fix the guard page.
1958         * pthread.c (pthread_initialize): Set rlimit correctly for
1959         NEED_SEPARATE_REGISTER_STACK.
1961 1999-12-16  H.J. Lu  <hjl@gnu.org>
1963         * pthread.c (__pthread_initialize_manager): Pass
1964         __pthread_manager_thread_bos instead of
1965         __pthread_manager_thread_tos to __clone2.
1967 1999-12-16  H.J. Lu  <hjl@gnu.org>
1969         * manager.c (pthread_allocate_stack): Correct the calculation
1970         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1971         stack bottom.
1973 1999-12-13  H.J. Lu  <hjl@gnu.org>
1975         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
1976         bit after setting ar.ccv.
1978 1999-12-12  H.J. Lu  <hjl@gnu.org>
1980         * manager.c (pthread_allocate_stack): Make the starting
1981         address of the stack bottom page aligned. FIXME: it may
1982         need changes in other places.
1983         (pthread_handle_create): Likewise.
1985 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
1987         * manager.c (pthread_allocate_stack): Handle
1988         NEED_SEPARATE_REGISTER_STACK.
1989         (pthread_handle_create): Likewise.
1990         * pthread.c (__pthread_initialize_manager): Likewise.
1992         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
1994 1999-12-02  H.J. Lu  <hjl@gnu.org>
1996         * sysdeps/ia64/pt-machine.h: New.
1998 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
2000         * wrapsyscall.c: Mark non-__ protected names as weak.
2001         PR libc/1466.
2003 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
2005         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
2007 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
2009         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
2010         Add tests also to new alternative spinlock implementation.
2011         * spinlock.h: Likewise.
2012         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2014 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
2016         * Version: Export __sigaction.
2017         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
2018         of __sigaction.
2019         * pthread.c: Use __libc_sigaction instead of __sigaction.
2021         * condvar.c: Implement pthread_condattr_getpshared and
2022         pthread_condattr_setpshared.
2023         * mutex.c: Implement pthread_mutexattr_getpshared and
2024          pthread_mutexattr_setpshared.
2025         * Versions: Export new functions.
2026         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2028         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
2029         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
2030         is not selected.
2032 2000-07-04  Greg McGary  <greg@mcgary.org>
2034         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
2035         pragmas.  Include bp-sym.h only if _LIBC.
2037 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
2039         * spinlock.c (__pthread_unlock): Properly place write barrier.
2040         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2042 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
2044         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
2045         faster on SMP systems.  No more emulation of compare&swap for adaptive
2046         spinlocks.
2047         * spinlock.h: Likewise.
2048         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
2049         Replace fast with adaptive mutex.
2050         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
2051         * condvar.c: Likewise.
2052         * pthread.c: Define and initialize __pthread_smp_kernel variable.
2053         * internals.h: Declare __pthread_smp_kernel.
2054         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
2055         _pthread_fastlock structure.
2056         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2058         * pthread.c: Remove initialization to zero from global variables.
2060 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
2062         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
2064 2000-06-28  Greg McGary  <greg@mcgary.org>
2066         * weaks.c: Wrap BP_SYM () around weak extern declarations of
2067         pthread functions that have pointers in their return+arg signatures.
2069 2000-06-27  Greg McGary  <greg@mcgary.org>
2071         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
2072         extern declarations of pthread functions that have pointers in
2073         their return+arg signatures.
2075 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
2077         * Makefile (tests): Add ex11.  Add rules to build it.
2078         * Examples/ex11.c: New file.
2079         * rwlock.c: Fix complete braindamaged previous try to implement
2080         timedout functions.
2082         * spinlock.c: Pretty print.
2084 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
2086         * Makefile (tests): Add ex10.  Add rules to build it.
2087         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
2088         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
2089         * condvar.c (pthread_cond_wait): Allow mutex of kind
2090         PTHREAD_MUTEX_TIMED_NP.
2091         (pthread_cond_timedwait_relative): Likewise.
2092         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
2093         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
2094         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2095         (__pthread_mutex_lock): Use __pthread_alt_lock for
2096         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2097         (__pthread_mutex_timedlock): New function.
2098         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
2099         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2100         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
2101         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
2102         * spinlock.c: Implement alternate fastlocks.
2103         * spinlock.h: Add prototypes.
2104         * Examples/ex10.c: New file.
2105         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2106         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2108         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
2109         (__pthread_rwlock_timedrdlock): New function.
2110         (__pthread_rwlock_timedwrlock): New function.
2111         Use laternate fastlock function everywhere.
2113 2000-06-21  Andreas Jaeger  <aj@suse.de>
2115         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
2116         prototype.
2118         * join.c: Include <stdlib.h> for exit prototype.
2120 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
2122         * sysdeps/i386/useldt.h: Include <stdlib.h>.
2124         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
2125         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2127         * Makefile (libpthread-routines): Add barrier.
2128         (tests): Add ex9.  Add rule to build ex9.
2129         * Versions: Export barrier functions.
2130         * barrier.c: New file.
2131         * Examples/ex9.c: New file.
2132         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
2133         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
2134         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2136 2000-06-19  H.J. Lu  <hjl@gnu.org>
2138         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
2139         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
2140         (compare_and_swap_with_release_semantics): New. Default to
2141         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
2142         is not defined.
2144         * spinlock.c (__pthread_unlock): Call
2145         compare_and_swap_with_release_semantics () instead of
2146         compare_and_swap ().
2148 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
2150         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
2151         to errno directly.
2152         * sysdeps/pthread/timer_delete.c: Likewise.
2153         * sysdeps/pthread/timer_getoverr.c: Likewise.
2154         * sysdeps/pthread/timer_gettime.c: Likewise.
2155         * sysdeps/pthread/timer_settime.c: Likewise.
2157 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2159         Timer nodes are now reference counted, and can be marked
2160         as deleted. This allows for the safe release of the global mutex
2161         in the middle without losing the timer being operated on.
2163         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
2164         member is now an enum with three values, so that an intermediate
2165         state can be represented (deleted but not free for reuse yet).
2166         New refcount member added.
2167         * sysdeps/pthread/timer_routines.c: Likewise.
2169         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
2170         timer_valid): New inline functions added.
2172         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
2173         restructured, recursive deadlock bug fixed.
2175         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
2176         timer_addref to ensure that timer won't be deleted while mutex is not
2177         held. Also uses timer_invalid to perform validation of timer handle.
2178         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
2179         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
2181 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
2183         * shlib-versions: Add entry for SH.
2184         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
2186 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2188         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
2189         tightened up some critical regions and micro-optimized some list
2190         manipulation code.
2192         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2193         Returns int value now to indicate whether timer was queued at head.
2194         * sysdeps/pthread/posix-timer.h: Likewise.
2195         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
2196         new return value from __timer_thread_queue_timer to avoid waking
2197         up timer thread unnecessarily.
2199         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
2200         inuse flag, because this requires mutex to be held.  Callers updated
2201         to do the check when they have the mutex.
2202         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
2204         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
2205         regions: avoids making system calls while holding timer mutex, and
2206         a few computations were moved outside of the mutex as well.
2207         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
2209         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
2210         to list_unlink_ip, meaning idempotent.  Pointer manipulation
2211         changed to get better better code out of gcc.
2212         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
2213         version of list_unlink added here.
2214         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
2215         function in all places: idempotent one for timers, non-idempotent
2216         one for thread nodes.
2217         * sysdeps/pthread/timer_settime: Likewise.
2218         * sysdeps/pthread/timer_routines.c: Likewise.
2220 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
2222         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
2223         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2225         * sysdeps/pthread/Makefile: Remove tests definition.
2227 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
2228             Yutaka Niibe  <gniibe@chroot.org>
2230         * sysdeps/sh/pspinlock.c: New file.
2231         * sysdeps/sh/pt-machine.h: New file.
2233 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
2235         * Makefile (tests): Add joinrace.
2237         * Examples/ex6.c: Test return value of pthread_join.
2239 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
2241         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
2242         (__pthread_spin_trylock): Implement.
2243         (__pthread_spin_unlock): Implement.
2244         (__pthread_spin_init): Implement.
2245         (__pthread_spin_destroy): Implement.
2247 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2249         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
2250         really append the entry.
2252 2000-06-10  Andreas Jaeger  <aj@suse.de>
2254         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
2256 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
2258         * sysdeps/pthread/timer_create.c: Thread matching now done on
2259         clock type as well as thread attributes.
2260         There are individual global signal-delivering threads for
2261         different clock types.
2262         * sysdeps/pthread/posix-timer.h: Likewise.
2263         * sysdeps/pthread/timer_routines.c: Likewise.
2265         * sysdeps/pthread/timer_routines.c: Thread allocation and
2266         deallocation function now remembers to put thread on active
2267         list and remove from active list.
2268         Thus now the feature of binding multiple timers
2269         to a single thread actually works.
2271 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2273         * pthread.c (__pthread_create_2_1): Optimize a bit.
2275         * internals.h (invalid_handle): Also test for p_terminated != 0.
2276         (nonexisting_handle): New function.  Same as old invalid_handle.
2277         * join.c (pthread_join): Use nonexisting_handle instead of
2278         invalid_handle to test for acceptable thread handle.
2279         * manager.c (pthread_handle_free): Likewise.
2280         * joinrace.c: New file.
2281         Reported by Permaine Cheung <pcheung@cygnus.com>.
2283 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2285         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2286         Correct handling of matching variable.
2288         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
2289         avoid warnings.
2291         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2292         Be prepared for empty timer list.
2294         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
2295         CPUTIME clock ID.  Add support for thread clocks.
2297         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
2298         subtraction were switched.
2300         * sysdeps/pthread/timer_routines.c (init_module): Use
2301         THREAD_MAXNODES threads.
2303         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
2304         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
2305         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
2306         with sigqueueinfo is this system call is available.
2308         * sysdeps/pthread/timer_create.c (timer_create): Allow
2309         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
2311         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
2312         functionality.
2313         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
2315 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2317         * sysdeps/pthread/posix-timer.h: New file.
2318         * sysdeps/pthread/timer_create.c: New file.
2319         * sysdeps/pthread/timer_delete.c: New file.
2320         * sysdeps/pthread/timer_getoverr.c: New file.
2321         * sysdeps/pthread/timer_gettime.c: New file.
2322         * sysdeps/pthread/timer_routines.c: New file.
2323         * sysdeps/pthread/timer_settime.c: New file.
2324         * sysdeps/pthread/tst-timer.c: New file.
2326 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2328         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
2329         LINK_MAX definitions if necessary.
2331 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2333         Added missing fork time handling of global libio lock.
2335         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
2336         not just the individual stream locks. Rewritten to use new
2337         iterator interface provided by libio rather than accessing
2338         global variable.
2340         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
2341         which lock and unlock the stream list using the new interface
2342         provied by libio.
2343         * internals.h: Likewise.
2345         * ptfork.c (__fork): Now calls __flockfilelist before fork,
2346         and __funlockfilelist in the parent after the fork.
2347         Child still calls __fresetlockfiles as before.
2349         * linuxthreads.texi: Now explains what happens to streams at
2350         fork time. Also whole new section on forking and thread added.
2351         Definition of pthread_atfork moved out of Miscellaneous Functions
2352         to this new section.
2354 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
2356         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
2357         Add missing register.
2358         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
2360 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
2362         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
2363         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
2364         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
2366 2000-05-31  Andreas Jaeger  <aj@suse.de>
2368         * sysdeps/mips/pspinlock.c: Implement spinlocks.
2370 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
2372         * spinlock.c (__pthread_lock): Remove ASSERT.
2374         * Makefile (tests): Add ex8.
2375         * Examples/ex8.c: New file.
2377 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
2379         Bugfix: The pthread_atfork mechanism now takes care of its
2380         own internal mutex at fork time.
2382         * ptfork.c (__fork): Revised so that the mutex is held across
2383         the fork operation and while the handlers are called, and so that
2384         the child resets the mutex.
2386         * linuxthreads.texi: Updated pthread_atfork documentation to make
2387         it clear that fork and pthread_atfork can't be reentered from
2388         atfork handlers, that pthread_atfork and fork are mutually atomic,
2389         and that the handlers are inherited by the child process.
2391 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
2393         * Makefile (libpthread-routines): Add pspinlock.
2394         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
2395         Use struct _pthread_fastlock instead of pthread_spinlock_t.
2396         * condvar.c: Likewise.
2397         * internals.h: Likewise.
2398         * join.c: Likewise.
2399         * manager.c: Likewise.
2400         * mutex.c: Likewise.
2401         * pthread.c: Likewise.
2402         * rwlock.c: Likewise.
2403         * semaphore.c: Likewise.
2404         * signals.c: Likewise.
2405         * spinlock.h: Likewise.
2406         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
2407         * sysdeps/alpha/pspinlock.c: New file.
2408         * sysdeps/arm/pspinlock.c: New file.
2409         * sysdeps/i386/pspinlock.c: New file.
2410         * sysdeps/m68k/pspinlock.c: New file.
2411         * sysdeps/mips/pspinlock.c: New file.
2412         * sysdeps/powerpc/pspinlock.c: New file.
2413         * sysdeps/sparc/sparc32/pspinlock.c: New file.
2414         * sysdeps/sparc/sparc64/pspinlock.c: New file.
2415         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
2416         back to _pthread_fastlock.  Define new pthread_spinlock_t.
2418 2000-05-24  Andreas Jaeger  <aj@suse.de>
2420         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
2422 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
2424         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
2426 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
2428         * internals.h (__RES_PTHREAD_INTERNAL): Define.
2430 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2432         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
2433         object state is represented with additional bits which distinguish
2434         whether that state was set up in the current process, or
2435         in an ancestor process. If that state was set in an ancestor,
2436         it means that a fork happened while thread was executing the init
2437         function. In that case, the state is reset to NEVER.
2438         * mutex.c (__pthread_once_fork_prepare): New function.
2439         (__pthread_once_fork_child): Likewise
2440         (__pthread_once_fork_parent): Likewise
2441         (__pthread_reset_pthread_once): Removed.
2442         * ptfork.c (__fork): Call new handlers in mutex.c.
2443         * internals.h: Declarations of new mutex.c functions added.
2444         Declaration of removed function deleted.
2445         * linuxthreads.texi: Updated documentation about pthread_once
2446         to clarify what happens under cancellation and forking.
2448 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2450         * internals.h: New thread manager request type, REQ_KICK.
2451         * join.c (pthread_exit): main thread now calls exit() instead
2452         of _exit() in order to proper process cleanup.
2453         * manager.c (__pthread_manager): Do not terminate manager
2454         after unblocking main thread; wait for main thread's
2455         REQ_PROCESS_EXIT request instead.
2456         Also, added REQ_KICK case to handle new request; this just does
2457         nothing.
2458         * manager.c (pthread_exited): Do not terminate manager after
2459         unblocking main thread.
2460         * manager.c (__pthread_manager_sighandler): If the main thread
2461         is waiting for all other threads to die, send a REQ_KICK into
2462         the thread manager request pipe to get it to clean out the threads
2463         and unblock the main thread as soon as possible. This fixes
2464         the 2000 millisecond hang on shutdown bug.
2465         * Examples/ex7.c: New file, tests shutdown behavior when all threads
2466         including the main one call pthread_exit(), or implicitly do so.
2467         * Makefile (tests): Add ex7.
2469 2000-05-05  Andreas Jaeger  <aj@suse.de>
2471         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2472         (pthread_getcpuclockid): Correct test for ourselves.
2474 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
2476         * internals.h (struct _pthread_descr_struct): Reorganization.
2477         Allocate room for 16 pointers at head of the structure for future
2478         thread-local data handling.  Move p_self member in this area.
2479         * manager.c (pthread_handle_create): Adjust use of p_self.
2480         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
2481         * pthread.c (__pthread_initial_thread): Adjust initialization.
2482         (__pthread_manager_thread): Likewise.
2484 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
2486         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
2487         for eventmask larger than 1 word.
2489 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
2491         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
2492         * pthread.c (__pthread_initialize_minimal): New function.  Perform
2493         minimal initialization.
2494         (pthread_initialize): Remove this code here.
2495         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
2496         are working around the problem in glibc.
2498 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
2500         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
2501         now.  First gcc must be fixed (more concrete: libgcc).
2503 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
2505         * pthread.c: Remove special treatement for interrupt handlers on x86.
2506         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
2507         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
2508         necessary.
2509         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
2511 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
2513         * join.c (pthread_exit): Set p_terminated after reporting the
2514         termination event instead of before.
2516 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
2518         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
2519         if __USE_UNIX98.
2521 2000-04-18  Andreas Jaeger  <aj@suse.de>
2523         * Versions: Use ld instead of ld.so.
2525 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2527         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
2528         Remove the typedef keyword.
2530 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2532         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
2533         not stbar.
2534         (READ_MEMORY_BARRIER): Define.
2535         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
2536         MEMORY_BARRIER.
2537         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
2538         headers.
2540 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
2542         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2543         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
2544         use thread_handle().
2546 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
2548         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
2549         if fast mutex is used.  Don't initialize `already_canceled' twice.
2550         Correctly test for return value of timedsuspend.
2552         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
2553         therefore don't need the _rt versions of the signal handlers.
2555 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2557         * pthread.c (pthread_yield): New function.
2558         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
2559         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
2560         * internals.h: Declare __pthread_yield.
2562         * pthread.c (pthread_initialize): Avoid a bit more code if
2563         realtime signals are known to exist.
2565         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
2566         to dynamically detect RT signals and avoid generating compatibility
2567         functions with old kernel.
2568         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
2569         __pthread_restart_new directly.
2570         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
2571         __pthread_wait_for_restart_signal directly.
2572         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
2573         __pthread_timedsuspend_new directly.
2575 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2577         * condvar.c: Remove all the special code to handle cond_timedwait.
2578         Use timedsuspend instead.
2579         * internals.h: Declare __pthread_timedsuspend_old,
2580         __pthread_timedsuspend_new, and __pthread_timedsuspend.
2581         Remove declaration of __pthread_init_condvar.
2582         * pthread.c: Define __pthread_timedsuspend variable.
2583         (__pthread_timedsuspend_old): New function.  Timed suspension
2584         implementation for old Linux kernels.
2585         (__pthread_timedsuspend_new): New function.  Timed suspension
2586         implementation for new Linux kernels.
2587         * restart.h (timedsuspend): New function.  Call appropriate
2588         suspension function through __pthread_timedsuspend.
2589         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
2590         the code.
2591         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2593         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
2594         undefined.
2595         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
2596         where possible.
2597         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
2598         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2600         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
2601         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2603 2000-04-14  Andreas Jaeger  <aj@suse.de>
2605         * weaks.c: Fix typo.
2607         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
2608         2.2 for linuxthreads.
2610 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
2612         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2613         (pthread_getcpuclockid): Fix typo.
2615 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
2617         * Makefile (libpthread-routines): Add getcpuclockid.
2618         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
2619         * sysdeps/pthread/getcpuclockid.c: New file.
2620         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
2621         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
2623         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
2624         Defined.
2625         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2627         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
2628         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2629         and pthread_spin_unlock.
2630         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
2631         into pthread_spinlock_t.  Change all uses.
2632         * spinlock.c: Implement pthread_spin_lock.
2633         Rename __pthread_unlock to __pthread_spin_unlock and define weak
2634         alias for real name.
2635         Define pthread_spin_trylock, pthread_spin_init, and
2636         pthread_spin_destroy.
2637         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2638         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
2639         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2640         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
2641         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2642         and pthread_spin_unlock.
2643         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
2644         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2645         * condvar.c: Likewise.
2646         * internals.h: Likewise.
2647         * join.c: Likewise.
2648         * manager.c: Likewise.
2649         * mutex.c: Likewise.
2650         * pthread.c: Likewise.
2651         * rwlock.c: Likewise.
2652         * semaphore.c: Likewise.
2653         * signals.c: Likewise.
2655         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
2656         macros.
2657         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
2659 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2661         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
2662         _POSIX_SHARED_MEMORY_OBJECTS.
2664 2000-04-11  Andreas Jaeger  <aj@suse.de>
2666         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
2667         (__compare_and_swap): Mark as modifying memory.
2669 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
2671         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
2672         __volatile__.
2673         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
2674         Don't have the 'asm' __volatile__.
2676 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2678         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
2679         * spinlock.c (__pthread_lock): Add memory barriers.
2680         (__pthread_unlock): Likewise.
2681         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
2682         instruction.
2683         (RELEASE): Not needed anymore.
2684         (__compare_and_swap): Mark asm as modifying memory.
2685         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
2686         of MEMORY_BARRIER.
2687         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
2688         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
2689         (MEMORY_BARRIER): Define using stbar.
2690         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
2691         stbar.
2692         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
2693         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
2694         Mike Burrows <m3b@pa.dec.com>.
2696 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
2698         * signals.c (sigaction): Fix return value for the case SIG is one
2699         of the signals the implementation uses.
2700         Patch by Xavier.Leroy@inria.fr.
2702 2000-04-01  Andreas Jaeger  <aj@suse.de>
2704         * attr.c: Use shlib-compat macros.
2705         * oldsemaphore.c: Likewise.
2706         * pthread.c: Likewise.
2707         * weaks.c: Likewise.
2709 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
2711         * semaphore.c (sem_timedwait): New function.
2712         Patch by Carl Mailloux <carlm@oricom.ca>.
2713         * semaphore.h: Declare sem_timedwait.
2714         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
2716 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
2718         * sysdeps/pthread/Makefile: File removed.
2720 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
2722         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
2723         * internals.h (__pthread_reset_pthread_once): Add prototype.
2724         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
2726         * manager.c (pthread_handle_create): Store ID of new thread before
2727         clone call.
2729 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
2731         * attr.c: Use new macros from shlib-compat.h to define versions.
2732         * oldsemaphore.c: Likewise.
2733         * semaphore.c: Likewise.
2734         * weaks.c: Likewise.
2736         * pthread.c: Update for new SHLIB_COMPAT definition.
2738         * manager.c (__pthread_manager): Unmask debug signal.
2740         * pthread.c (pthread_initialize): Test for address of __dso_handle
2741         being NULL, not value.  Use __on_exit, not on_exit.
2742         Patch by Andreas Jaeger <aj@suse.de>.
2744         * pthread.c: Use new macros from shlib-compat.h to define versions.
2746 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
2748         * pthread.c (pthread_initialize): Instead of on_exit use
2749         __cxa_atexit if __dso_label is available to allow unloading the
2750         libpthread shared library.
2752 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
2754         * condvar.c: Make tests for ownership of mutex less strict.
2756 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
2758         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
2759         current thread and return error if not.
2760         (pthread_cond_timedwait_relative_old): Likewise.
2761         (pthread_cond_timedwait_relative_new): Likewise.
2763         * mutex.c (__pthread_once): Handle cancelled init function correctly.
2764         (pthread_once_cancelhandler): New function.
2765         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2767 2000-03-14  Andreas Jaeger  <aj@suse.de>
2769         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
2770         REG_GS.
2771         (pthread_handle_sigrestart_rt): Likewise.
2772         * signals.c (pthread_sighandler_rt): Likewise.
2774 2000-03-02  Andreas Jaeger  <aj@suse.de>
2776         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
2777         Reported by Sean Chen <sean.chen@turbolinux.com>.
2779 2000-02-28  Andreas Jaeger  <aj@suse.de>
2781         * rwlock.c: Fix typo.
2783 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
2785         * rwlock.c: Define __* variants of the functions and make old names
2786         aliases.
2787         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
2788         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
2790 2000-02-25  Andreas Jaeger  <aj@suse.de>
2792         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2793         pwrite64, lseek64, open64, and __open64 with version 2.2.
2795 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
2797         * semaphore.h (SEM_FAILED): Use 0 not NULL.
2799 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
2801         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
2802         nanosleep does not work either.  Get absolute time inside the
2803         loop.
2804         (pthread_cond_timedwait_relative_new): Likewise.
2805         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2807 2000-02-13  Andreas Jaeger  <aj@suse.de>
2809         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
2810         (pthread_cond_timedwait_relative_old): Likewise.
2812 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
2814         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
2815         but keep the code around.  A bug in the kernel prevent us from
2816         using the code.
2817         (pthread_cond_timedwait_relative_new): Likewise.
2818         (PR libc/1597 and libc/1598).
2820 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
2822         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
2823         loop around nanosleep calls instead of around most of the function
2824         (pthread_cond_timedwait_relative_new): Likewise.
2825         body.  Got rid of backwards goto and one local.
2827 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
2829         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
2830         before every nanosleep call to account for time spent in the rest
2831         of the function.
2832         (pthread_cond_timedwait_relative_new): Likewise.
2833         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
2835 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
2837         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
2838         from nanosleep call so that in case we restart we only wait for the
2839         remaining time.
2840         (pthread_cond_timedwait_relative_new): Likewise.
2841         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
2843 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
2845         * manager.c (pthread_allocate_stack): Compute guard page address
2846         correctly.  Patch by HJ Lu.
2848         * sysdeps/pthread/pthread.h: Define
2849         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
2851 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
2853         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
2854         preference handling.
2855         (pthread_rwlockattr_setkind_np): Allow
2856         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
2857         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2859 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
2861         * internals.h (pthread_readlock_info): New structure.
2862         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
2863         p_untracked_readlock_count.
2864         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2865         Add initializers for new fields.
2866         * manager.c (pthread_free): Free read/write lock lists.
2867         * queue.h (queue_is_empty): New function.
2868         * rwlock.c: Implement requirements about when readers should get
2869         locks assigned.
2870         * sysdeps/pthread/pthread.h
2871         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
2872         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
2873         Define this name as well.
2874         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2876 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
2878         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2879         Adjust initializers for struct _pthread_descr_struct change.
2880         * internals.h (struct _pthread_descr_struct): Move new elements to
2881         the end.
2883 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
2885         Redesigned how cancellation unblocks a thread from internal
2886         cancellation points (sem_wait, pthread_join,
2887         pthread_cond_{wait,timedwait}).
2888         Cancellation won't eat a signal in any of these functions
2889         (*required* by POSIX and Single Unix Spec!).
2890         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
2891         simultaneous condition variable signal (not required by POSIX
2892         or Single Unix Spec, but nice).
2893         * spinlock.c: __pthread_lock queues back any received restarts
2894         that don't belong to it instead of assuming ownership of lock
2895         upon any restart; fastlock can no longer be acquired by two threads
2896         simultaneously.
2897         * restart.h: Restarts queue even on kernels that don't have
2898         queued real time signals (2.0, early 2.1), thanks to atomic counter,
2899         avoiding a rare race condition in pthread_cond_timedwait.
2901 1999-12-31  Andreas Jaeger  <aj@suse.de>
2903         * internals.h: Remove duplicate prototype declarations.
2905         * weaks.c: Remove __THROW from prototypes since the file is not
2906         compiled by a C++ compiler.
2907         * internals.h: Likewise.
2909 1999-12-30  Andreas Jaeger  <aj@suse.de>
2911         * sysdeps/pthread/pthread.h: Move internal functions to...
2912         * sysdeps/pthread/bits/libc-lock.h: ...here.
2914 1999-12-29  Andreas Jaeger  <aj@suse.de>
2916         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
2918 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
2920         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
2921         beginning.
2923         * manager.c (__pthread_start): Add one more cast to prevent
2924         warning on 64bit machines.
2926 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
2928         * manager.c (pthread_handle_create): Set p_pid of new thread
2929         before calling the callback function to report a new thread.
2931 1999-12-20  Andreas Jaeger  <aj@suse.de>
2933         * pthread.c (pthread_initialize): Move getrlimit call after
2934         setting of errno.
2936 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
2938         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2939         pwrite64, lseek64, open64, and __open64.
2940         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2941         pwrite64, lseek64, open64, and __open64.
2943         * manager.c (pthread_allocate_stack): Correct computation of
2944         new_thread_bottom.  Correct handling of stack size and when the
2945         rlimit method to guard for stack growth is used.
2946         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2947         minus one pagesize (not two).
2949 1999-12-03  Andreas Jaeger  <aj@suse.de>
2951         * Versions: Add __res_state with version GLIBC_2.2.
2953         * errno.c (__res_state): New function to return thread specific
2954         resolver state.
2956         * pthread.c (pthread_initialize): Initialize p_resp.
2957         (__pthread_reset_main_thread): Also set p_resp.
2959         * manager.c (pthread_handle_create): Initialize p_resp.
2961         * internals.h: Add thread specific resolver state.
2962         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2964 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
2966         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2967         beginning.
2968         * sysdeps/i386/i686/pt-machine.h: Likewise.
2969         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2971 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
2973         * manager.c (pthread_start_thread_event): Initialize p_pid already
2974         here.
2976 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
2978         * internals.h: Add prototype for __pthread_manager_event.
2979         * manager.c (__pthread_manager_event): New function.
2980         (pthread_start_thread_event): Correct computation of self.
2981         Use INIT_THREAD_SELF.
2982         * pthread.c (__pthread_manager_thread): Initialize p_lock.
2983         (__pthread_initialize_manager): Respect event flags also for creation
2984         of the manager thread.
2986 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
2988         * pthread.c (__pthread_initialize_manager): Initialize
2989         __pthread_manager_thread.p_tid.
2991 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
2993         * internals.h: Declare __pthread_last_event.
2994         * manager.c: Define __pthread_last_event.
2995         (pthread_handle_create): Set __pthread_last_event.
2996         (pthread_exited): Likewise.
2997         * join.c (pthread_exit): Likewise.
2999         * Makefile (libpthread-routines): Add events.
3000         * events.c: New file.
3001         * internals.h: Protect against multiple inclusion.
3002         Include thread_dbP.h header.
3003         (struct _pthread_descr_struct): Add new fields p_report_events and
3004         p_eventbuf.
3005         Declare event reporting functions.
3006         * join.c (pthread_exit): Signal event if this is wanted.
3007         * manager.c (__pthread_threads_events): New variable.
3008         (pthread_handle_create): Take new parameters with event information.
3009         Signal TD_CREATE event if wanted.
3010         (__pthread_manager): Adjust pthread_handle_create call.
3011         (pthread_start_thread_event): New function.  Block until manager is
3012         finished and then call pthread_start_thread.
3013         (pthread_exited): Signal TD_REAP event if wanted.
3015 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
3017         * restart.h (suspend_with_cancellation): Rewrite as a macro.
3019         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
3021 1999-10-25  Andreas Jaeger  <aj@suse.de>
3023         * internals.h: Remove K&R compatibility.
3024         * no-tsd.c: Likewise.
3025         * semaphore.h: Likewise.
3026         * signals.c: Likewise.
3027         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
3028         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
3029         * weaks.c: Likewise.
3031 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
3033         * pthread.c: For i386, wrap pthread_handle_sigrestart and
3034         pthread_handle_sigcancel with functions that restore %gs from the
3035         signal context.  For each signal handling function, two wrappers
3036         are required, one for a non-RT signal and one for a RT signal.
3037         * signal.c: For i386, add code to restore %gs from the signal
3038         context in pthread_sighandler and pthread_sighandler_rt.
3040 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
3042         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
3044 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
3046         * pthread.c (__pthread_initial_thread): Pass argument to
3047         PTHREAD_START_ARGS_INITIALIZER.
3048         (__pthread_manager_thread): Likewise.
3050         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
3051         initialize function.
3053         * manager.c (pthread_handle_create): Remove p_startfct initialization.
3055         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
3057 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
3059         * internals.h: Correct return types for __libc_read and __libc_write.
3061 1999-10-09  Andreas Jaeger  <aj@suse.de>
3063         * internals.h: Add __new_sem_post to get prototype in
3064         manager.c; include semaphore.h for needed types.
3066 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
3068         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
3069         directly instead of calling sem_post which should not be necessary
3070         but is faster and might help in some case to work around problems.
3071         Patch by khendricks@ivey.uwo.ca [libc/1382].
3073 1999-10-08  Andreas Schwab  <schwab@suse.de>
3075         * sysdeps/pthread/Subdirs: New file.
3076         * Implies: Removed.
3078 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
3080         * Implies: New file.
3081         * internals.h (struct _pthread_descr_struct): Add p_startfct.
3082         * manager.c (pthread_handle_create): Initialize p_startfct.
3083         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
3085 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
3087         * manager.c (__linuxthreads_pthread_threads_max): New variable.
3088         * specific.c (__linuxthreads_pthread_keys_max): New variable.
3089         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
3091         * condvar.c (pthread_cond_timedwait_relative): Never return with
3092         EINTR.  Patch by Andreas Schwab.
3094 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
3096         * signals.c (sigaction): Correct last patch.  Don't select
3097         pthread_sighandler_rt based on the signal number but instead of
3098         the SA_SIGINFO flag.
3100 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
3102         * specific.c: Move definitions of struct pthread_key_struct and
3103         destr_function to ...
3104         * internals.h: ...here.
3106 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
3108         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
3109         this instead of pthread_handle_sigrestart if the signal is an RT
3110         signal.
3112         * signals.c: Handle passing through of sighandler arguments also
3113         for real-time signals.
3115 1999-09-03  Andreas Schwab  <schwab@suse.de>
3117         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
3118         fork as weak alias.
3119         (__vfork): New function, alias vfork.
3120         * Versions: Export __fork, vfork, and __vfork in libpthread.
3122 1999-08-23  Andreas Schwab  <schwab@suse.de>
3124         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
3125         call to signal handler.
3127 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
3129         * pthread.c (__pthread_reset_main_thread): Undo last change.
3130         (__pthread_kill_other_threads_np): Reset signal handlers for the
3131         signals we used in the thread implementation here.
3133 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
3135         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
3136         for the signals we used in the thread implementation [PR libc/1234].
3138         * Versions: Export __pthread_kill_other_threads_np from libpthread
3139         for GLIBC_2.1.2.
3141         * signals.c: Pass sigcontext through wrapper to the user function.
3143 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
3145         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
3146         __libc_internal_tsd_set.
3148 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3150         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
3151         needed anymore.
3153 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3155         * internals.h: Align _pthread_descr_struct to 32 bytes.
3156         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
3157         libc/1206.
3159 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3161         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
3162         swap function.
3164 1999-07-09  Cristian Gafton  <gafton@redhat.com>
3166         * Makefile (libpthread-routines): Add oldsemaphore routine.
3167         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
3168         sem_trywait, and sem_wait to GLIBC_2.1.
3169         * oldsemaphore.c: New file.
3170         * semaphore.c: Add default_symbol_versions for the changed functions.
3171         (__new_sem_init): Rename from sem_init.
3172         (__new_sem_post): Rename from sem_post.
3173         (__new_sem_wait): Rename from sem_wait.
3174         (__new_sem_trywait): Rename from sem_trywait.
3175         (__new_sem_getvalue): Rename from sem_getvalue.
3176         (__new_sem_destroy): Rename from sem_destroy.
3178 1999-06-23  Robey Pointer  <robey@netscape.com>
3180         * internals.h: Added p_nextlock entry to separate queueing for a
3181         lock from queueing for a CV (sometimes a thread queues on a lock
3182         to serialize removing itself from a CV queue).
3183         * pthread.c: Added p_nextlock to initializers.
3184         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
3186 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3188         * manager.c (pthread_handle_create): Free mmap region after stack
3189         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
3191 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3193         * man/pthread_cond_init.man: Correct example.
3194         Reported by Tomas Berndtsson <tomas@nocrew.org>.
3196         * linuxthreads.texi (Condition Variables): Likewise.
3198 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
3200         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
3201         casx not cas, also successful casx returns the old value in rd
3202         and not the new value.
3204 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
3206         * manager.c: If pthread_create() is given a NULL attribute
3207         and the thread manager runs with a realtime policy, set the
3208         scheduling policy of the newly created thread back to SCHED_OTHER.
3209         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
3210         initialize the schedpolicy field of new_thread->p_start_args
3211         to that of the calling thread.
3213 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
3215         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
3216         instruction does not allow memory element to use offset.
3218 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
3220         * manager.c (pthread_allocate_stack): Optimize initialization of new
3221         thread descriptor.
3223         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
3224         Don't use initializer since it is all zeroes.
3225         (__libc_once_define): Likewise.
3227 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3229         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
3230         doesn't exist anymore.
3231         * sysdeps/i386/Implies: Likewise.
3232         * sysdeps/m68k/Implies: Likewise.
3233         * sysdeps/mips/Implies: Likewise.
3234         * sysdeps/powerpc/Implies: Likewise.
3235         * sysdeps/sparc/sparc32/Implies: Likewise.
3236         * sysdeps/sparc/sparc64/Implies: Likewise.
3238 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
3240         * sysdeps/alpha/bits/semaphore.h: Removed.
3241         * sysdeps/powerpc/bits/semaphore.h: Removed.
3242         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
3243         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
3244         * Makefile (headers): Remove bits/semaphore.h.
3246         * semaphore.h: Define _pthread_descr if necessary.
3247         Don't include limits.h.  Define SEM_VALUE_MAX directly.
3248         Define SEM_FAILED.
3249         (sem_t): Protect element names with leading __.
3250         Add declarations for sem_close, sem_open, and sem_unlink.
3251         * semaphore.c: Adjust all functions for new element names.
3252         Define sem_close, sem_open, and sem_unlink.
3253         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
3254         GLIBC_2.1.1.
3255         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
3256         necessary.
3258 1999-03-16  H.J. Lu  <hjl@gnu.org>
3260         * specific.c (pthread_key_delete): Check th->p_terminated to see
3261         if the thread is running.
3263         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
3264         Added to GLIBC_2.0 for libc.so.
3266 1999-02-12  H.J. Lu  <hjl@gnu.org>
3268         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
3269         __libc_allocate_rtsig): Added to GLIBC_2.1.
3271         * internals.h (DEFAULT_SIG_RESTART): Removed.
3272         (DEFAULT_SIG_CANCEL): Removed.
3274         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
3275         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
3276         (__pthread_sig_restart, __pthread_sig_cancel,
3277         __pthread_sig_debug): Initialized.
3278         (pthread_initialize): Call init_rtsigs () to initialize
3279         real-time signals.
3281 1999-02-03  H.J. Lu  <hjl@gnu.org>
3283         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
3284         Don't restart the thread which sent REQ_DEBUG.
3285         (pthread_start_thread): Check if __pthread_sig_debug > 0
3286         before debugging.
3288         * pthread.c (__pthread_initialize_manager): Suspend ourself
3289         after sending __pthread_sig_debug to gdb instead of
3290         __pthread_sig_cancel.
3292 1999-01-24  H.J. Lu  <hjl@gnu.org>
3294         * manager.c (__pthread_manager): Delete __pthread_sig_debug
3295         from mask if __pthread_sig_debug > 0.
3296         (pthread_handle_create): Increment __pthread_handles_num.
3298         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
3299         * pthread.c (__pthread_initialize_manager): Likewise.
3301         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
3302         instead of __libc_allocate_rtsig (2).
3303         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
3304         instead of __pthread_sig_cancel.
3305         (pthread_handle_sigdebug): Fix comments.
3307 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
3309         * manager.c (pthread_allocate_stack): Set
3310         __pthread_nonstandard_stacks if user-specified stack is used.
3312 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
3314         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
3315         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
3317 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
3319         * pthread.c: Use a third signal __pthread_sig_debug distinct
3320         from __pthread_sig_cancel to notify gdb when a thread is
3321         created
3322         * manager.c: Likewise.
3323         * internals.h: Likewise.
3324         * signals.c: The implementation of sigwait(s) assumed that
3325         all signals in s have signal handlers already attached.
3326         This is not required by the standard, so make it work
3327         also if some of the signals have no handlers.
3329 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3331         * linuxthreads.texi: Remove pointers from first @node.  Move old
3332         @node spec inside comment.
3334 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
3336         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
3337         _IO_lock_unlock.
3339 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
3341         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
3342         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
3344 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
3346         * manager.c: Threads now send __pthread_sig_cancel on termination.
3347         Change clone call and signal masks.
3348         * thread.c (pthread_handle_sigrestart): Remove special code for
3349         manager.
3350         (pthread_handle_sigcancel): In manager thread call
3351         __pthread_manager_sighandler.
3352         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
3353         * sysdeps/i386/i686/pt-machine.h: Likewise.
3354         Patches by Xavier Leroy.
3356 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
3358         * spinlock.c (__pthread_unlock): Don't crash if called for an
3359         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
3361         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
3362         overall runtime.
3364 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
3366         * Examples/ex3.c: Wait until all threads are started before
3367         searching for the number to avoid race condition on very fast
3368         systems.
3370 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3372         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
3373         declaration since it's not needed.
3375         * sysdeps/pthread/pthread.h: Move internal functions to ...
3376         * internals.h: ...here.
3378 1998-12-02  H.J. Lu  <hjl@gnu.org>
3380         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
3381         SIGRTMIN is defined.
3382         (__pthread_sig_cancel): Likewise.
3384 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3386         * wrapsyscall.c: Include <sys/mman.h> for msync,
3387         <stdlib.h> for system and <termios.h> for tcdrain prototype.
3388         Correct msync declaration.
3390 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
3392         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
3393         __libc_tsd_set): New macros for new interface.
3394         * no-tsd.c: New file, provide uninitialized defns of
3395         __libc_internal_tsd_get and __libc_internal_tsd_set.
3396         * Makefile (routines): Add no-tsd.
3398 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
3400         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
3401         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3402         __libc_internal_tsd_set): Move decls to ...
3403         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
3404         declarations.
3406         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3407         __libc_internal_tsd_set): Make these pointers to functions, not
3408         functions; remove #pragma weak decls for them.
3409         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
3410         Define static functions and initialized pointers to them.
3412 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
3414         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
3415         (CFLAGS-specific.c): Likewise.
3416         (CFLAGS-pthread.c): Likewise.
3417         (CFLAGS-ptfork.c): Likewise.
3418         (CFLAGS-cancel.c): Likewise.
3419         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
3420         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
3422         * mutex.c (pthread_mutex_init): Define as strong symbol.
3423         (pthread_mutex_destroy): Likewise.
3424         (pthread_mutex_trylock): Likewise.
3425         (pthread_mutex_lock): Likewise.
3426         (pthread_mutex_unlock): Likewise.
3427         (pthread_mutexattr_init): Likewise.
3428         (pthread_mutexattr_destroy): Likewise.
3429         (pthread_once): Likewise.
3430         * ptfork.c (pthread_atfork): Likewise.
3431         * specific.c (pthread_key_create): Likewise.
3432         (pthread_setspecific): Likewise.
3433         (pthread_getspecific): Likewise.
3435 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3437         * linuxthreads.texi: Fix punctuation after xref.
3439 1998-11-10  H.J. Lu  <hjl@gnu.org>
3441         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
3442         if it is defined in <linux/limits.h>.
3444 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
3446         * spinlock.h (__pthread_trylock): Define inline.
3447         (__pthread_lock): Add extra parameter to declaration.  Declare
3448         using internal_function.
3449         (__pthread_unlock): Declare using internal_function.
3450         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
3451         of local variable self.  Avoid recomputing self.  Define using
3452         internal_function.
3453         (__pthread_trylock): Remove.
3454         (__pthread_unlock): Define using internal_function.
3455         * cancel.c: Adjust for __pthread_lock interface change.  Use already
3456         computed self value is possible.
3457         * condvar.c: Likewise.
3458         * join.c: Likewise.
3459         * manager.c: Likewise.
3460         * mutex.c: Likewise.
3461         * pthread.c: Likewise.
3462         * rwlock.c: Likewise.
3463         * semaphore.c: Likewise.
3464         * signals.c: Likewise.
3466 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
3468         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
3469         __ to field names of the struct.
3470         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
3471         Likewise.
3472         (pthread_attr_t): Likewise.
3473         (pthread_cond_t): Likewise.
3474         (pthread_condattr_t): Likewise.
3475         (pthread_mutex_t): Likewise.
3476         (pthread_mutexattr_t): Likewise.
3477         (pthread_rwlock_t): Likewise.
3478         (pthread_rwlockattr_t): Likewise.
3479         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
3480         * cancel.c: Likewise.
3481         * condvar.c: Likewise.
3482         * manager.c: Likewise.
3483         * mutex.c: Likewise.
3484         * pthread.c: Likewise.
3485         * ptlongjmp.c: Likewise.
3486         * rwlock.c: Likewise.
3487         * spinlock.c: Likewise.
3489 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
3491         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
3492         also with PT_EI.
3494         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
3495         definitions.
3497         * Makefile (libpthread-routines): Add pt-machine.
3498         * pt-machine.c: New file.
3499         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
3500         yet defined.  Use PT_EI in extern inline definitions.
3501         * sysdeps/arm/pt-machine.h: Likewise.
3502         * sysdeps/i386/pt-machine.h: Likewise.
3503         * sysdeps/i386/i686/pt-machine.h: Likewise.
3504         * sysdeps/m68k/pt-machine.h: Likewise.
3505         * sysdeps/mips/pt-machine.h: Likewise.
3506         * sysdeps/powerpc/pt-machine.h: Likewise.
3507         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
3508         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3510 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3512         * semaphore.h: Include <sys/types.h> so that _pthread_descr
3513         is declared.
3515 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
3517         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
3518         argument.
3519         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
3521 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3523         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
3524         guard.
3526 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3528         * signals.c (sigaction): Check that sig is less than NSIG to avoid
3529         array index overflow.
3531 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
3533         * sysdeps/pthread/semaphore.h: New file.
3535 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
3537         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
3538         _LIBC_TSD_KEY_DL_ERROR.
3540 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
3542         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
3543         * sysdeps/i386/pt-machine.h: Likewise.
3544         Suggested by Roland McGrath.
3546 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
3548         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
3549         access thread data with non-constant offsets.
3550         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
3551         necessary.
3553         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
3554         THREAD_SETMEM_NC definitions.
3556         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
3557         THREAD_SETMEM_NC.
3558         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3560 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
3562         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
3563         not already defined.
3564         (struct _pthread_descr_struct): Add p_self and p_nr field.
3565         * manager.c (__pthread_handles): Define second element to point
3566         to manager thread.
3567         (__pthread_handles_num): Initialize to 2.
3568         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
3569         (pthread_start_thread): Likewise.
3570         (pthread_handle_create): Start search for free slot at entry 2.
3571         Initialize new fields p_self and p_nr.
3572         Call __clone with CLONE_PTRACE if available.
3573         (pthread_free): Call FREE_THREAD_SELF if available.
3574         * pthread.c (__pthread_initial_thread): Initialize new fields.
3575         (__pthread_manager_thread): Likewise.
3576         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
3578         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
3579         elements of the thread descriptor.
3580         * condvar.c: Likewise.
3581         * errno.c: Likewise.
3582         * join.c: Likewise.
3583         * manager.c: Likewise.
3584         * pthread.c: Likewise.
3585         * ptlongjmp.c: Likewise.
3586         * semaphore.c: Likewise.
3587         * signals.c: Likewise.
3588         * specific.c: Likewise.
3589         * spinlock.c: Likewise.
3591         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
3593         * sysdeps/i386/useldt.h: New file.
3594         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
3596         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
3597         THREAD_SETMEM using __thread_self.
3598         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3600 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
3602         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
3603         turned out that we didn't need to queue after all.
3605 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
3607         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
3608         and wastes space; correct types.
3610 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
3612         * signals.c (sigaction): Handle NULL argument.
3614 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
3616         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
3617         of sigset_t.
3619 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3621         * Makefile (linuxthreads-version): Extract correct number from
3622         Banner.
3624 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
3626         * Banner: Bump version number to 0.8
3627         * FAQ.html: Many updates, in particular w.r.t. debugging.
3628         * manager.c: Support for non-default stacksize for
3629         LinuxThreads-allocated stacks;
3630         don't use guard pages for stacks with default size, rely on
3631         rlimit(RLIMIT_STACK) instead (it's cheaper).
3632         * attr.c: Likewise.
3633         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
3634         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
3635         * condvar.c: Likewise.
3636         * internals.h: Likewise.
3637         * restart.h: Likewise.
3638         * signals.c: Likewise.
3639         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
3641 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3643         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
3644         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
3645         * Versions: Put __pthread_mutexattr_settype under version
3646         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
3647         __pthread_mutexattr_gettype.
3649 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3651         * sysdeps/pthread/bits/libc-lock.h: Make
3652         __pthread_mutexattr_settype weak.  Don't make
3653         __pthread_mutexattr_setkind_np weak.
3655 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
3657         * manager.c (pthread_handle_create): Check whether sched_setscheduler
3658         call can succeed here.
3660         * mutex.c: Define __pthread_mutexattr_settype and make
3661         __pthread_mutexattr_setkind_np an alias.
3662         Likewise for __pthread_mutexattr_gettype.
3664 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3666         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
3667         is root.
3669 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
3671         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
3673 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3675         * Examples/ex6.c: Include <unistd.h> for usleep.
3677 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3679         * Examples/ex4.c (main): Use exit, not pthread_exit.
3681 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
3683         * Versions: Add __pthread_mutexattr_gettype and
3684         __pthread_mutexattr_settype.
3685         * lockfile.c: Use __pthread_mutexattr_settype instead of
3686         __pthread_mutexattr_setkind_np.
3687         * mutex.c: Define __pthread_mutexattr_gettype and
3688         __pthread_mutexattr_settype.
3689         * weak.c: Likewise.
3690         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
3691         __pthread_mutexattr_settype.
3692         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
3693         Use __pthread_mutexattr_settype.
3695 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
3697         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
3698         * mutex.c: Define weak alias pthread_mutexattr_gettype and
3699         pthread_mutexattr_settype.
3700         * sysdeps/pthread/pthread.h: Declare these functions.
3701         Move pthread_sigmask and pthread_kill declaration in separate header.
3702         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
3704 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
3706         * Makefile: Add rules to compile and run tests.
3707         * Examples/ex1.c: Little changes to fix warnings.
3708         * Examples/ex2.c: Likewise.
3709         * Examples/ex3.c: Likewise.
3710         * Examples/ex4.c: Likewise.
3711         * Examples/ex5.c: Likewise.
3712         * Examples/ex6.c: New file.
3714 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
3716         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
3718 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3720         * attr.c: Include <string.h>.
3722 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
3724         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
3725         * internals.h: Include limits.h.
3726         * manager.c: Use memcpy to copy sched_param.
3727         * ptfork.c: Include errno.h.
3728         * pthread.c: Likewise.
3729         * semaphore.c: Likewise.
3730         * specific.c: Likewise.
3731         * spinlock.h: Likewise.
3732         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
3733         type definition to ...
3734         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
3736 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
3738         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
3740         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
3741         as macros as demanded in POSIX.1, Annex C.
3743 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
3745         * internals.h (struct pthread_request): For free use pthread_t
3746         instead of pthread_descr.
3747         * join.c (pthread_join): Pass thread_id, not th to manager.
3748         (pthread_detach): Likewise.
3749         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
3750         (pthread_exited): Remove detached queue code.
3751         (pthread_handle_free): Expect thread ID parameter and use it to
3752         validate the thread decsriptor.  Don't use detached queue.
3753         Patches by Xavier Leroy.
3755 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3757         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
3758         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
3759         __pthread_atfork, __pthread_key_create, __pthread_once.
3760         * internals.h: Doc fix.
3761         * pthread.c (__pthread_initialize): Define again.
3763 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
3765         * manager.c (pthread_exited): If thread is not detached put it on
3766         special list.
3767         (pthread_handle_free): If thread is not on list with living threads
3768         search on list with detached threads.
3770         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
3771         for new definition of pthread_rwlock_t.
3773         * spinlock.c: Correct test whether to compile
3774         __pthread_compare_and_swap or not.
3776 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
3778         * attr.c: Finish user stack support.  Change locking code to be safe
3779         in situations with different priorities.
3780         * cancel.c: Likewise.
3781         * condvar.c: Likewise.
3782         * internals.h: Likewise.
3783         * join.c: Likewise.
3784         * manager.c: Likewise.
3785         * mutex.c: Likewise.
3786         * pthread.c: Likewise.
3787         * ptlongjmp.c: Likewise.
3788         * queue.h: Likewise.
3789         * rwlock.c: Likewise.
3790         * semaphore.c: Likewise.
3791         * semaphore.h: Likewise.
3792         * signals.c: Likewise.
3793         * spinlock.c: Likewise.
3794         * spinlock.h: Likewise.
3795         * sysdeps/pthread/pthread.h: Likewise.
3796         Patches by Xavier Leroy.
3798         * sysdeps/i386/i686/pt-machine.h: New file.
3800 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
3802         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
3803         [sg]et_stackaddr prototypes always available.
3805         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3806         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
3808 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
3810         * manager.c (pthread_free): Undo patch from 980430.
3811         Reported by David Wragg <dpw@doc.ic.ac.uk>.
3813 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
3815         * manager.c: Define __pthread_manager_adjust_prio and use it to
3816         increase priority when needed.
3817         * internals.h: Add prototype for __pthread_manager_adjust_prio.
3818         * mutex.c: Optimize mutexes to wake up only one thread.
3819         * pthread.c: Move PID of manager for global variable in structure
3820         element.
3821         Patches by Xavier Leroy.
3823 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
3825         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
3827 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3829         * attr.c: Correct typo.
3831 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
3833         * manager.c (pthread_free): Unmap guard before the stack.
3834         Patch by Matthias Urlichs.
3836 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
3838         * manager.c (pthread_free): Detect already free child.
3839         Patch by Xavier Leroy, reported by Matthias Urlichs.
3841 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3843         * Makefile (linuxthreads-version): Renamed back from
3844         libpthread-version.
3846 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
3848         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
3849         __libc_longjmp.
3851 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
3853         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
3854         * internals.h: Add definitions for new spinlock implementation.
3855         * ptlongjmp.c: New file.
3856         * spinlock.c: New file.
3857         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
3858         new function __pthread_acquire to prevent deadlocks with thread
3859         with different priorities.
3860         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
3862 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3864         * manager.c (__pthread_manager): Reduce first argument to select
3865         to include just the needed file descriptor.
3867 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
3869         * manager.c: Fix last patch which caused core dumps.
3871         * pthread.c: Correctly handle missing SIGRTMIN.
3873 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3875         * libpthread.map: Add __libc_internal_tsd_get and
3876         __libc_internal_tsd_set.  Add missing cancelable functions. Export
3877         libc internal versions of the cancelable functions.
3879 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
3881         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
3883 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
3885         * attr.c: Implement pthread_attr_[gs]etguardsize,
3886         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
3887         Change pthread_attr_init to have two interfaces.
3888         * internals.h (struct _pthread_descr_struct): Add new fields for
3889         above functions.
3890         * libpthread.map: Add names in GLIBC_2.1 section.
3891         * manager.c (pthread_handle_create): Implement guardsize and
3892         user stack.
3893         (pthread_free): Likewise.
3894         * pthread.c (pthread_create): Add new interface for changed
3895         pthread_attr_t.
3896         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
3897         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
3898         PTHREAD_STACK_MIN.
3900 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
3902         * manager.c: Enable resetting of the thread scheduling policy
3903         to SCHED_OTHER when the parent thread has a different one.
3905 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
3907         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3908         _POSIX_ASYNCHRONOUS_IO.
3910         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
3911         mutexes.
3912         * mutex.c: Implement new mutex types.
3914         * internals.h: Include <signal.h>.
3916         * libpthread.map: Add __erno_location and __h_errno_location.
3918         * errno.c: Return pointer to variable actually in use.  This might
3919         not be the one in the thread structure.
3920         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
3921         and p_h_errnop.
3922         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
3923         of manager thread structure.
3924         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
3925         thread.
3926         * pthread.c: Adapt initializer for thread structures.
3927         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
3928         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
3929         current thread to global variables.
3931 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
3933         * rwlock.c: New file.
3934         * Makefile (libpthread-routines): Add rwlock.
3935         * sysdeps/pthread/pthread.h: Define data structures and declare
3936         functions.
3937         * libpthread.map: Add new functions.
3939 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
3941         * sysdeps/arm/pt-machine.h: New file; add ARM support.
3942         * sysdeps/arm/Implies: likewise.
3943         * README: Document it.
3945 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3947         * signals.c: Remove unneeded initializer for sigwaited, saving a
3948         warning.
3950 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3952         * semaphore.c (sem_init): Set sem_spinlock only if available.
3954 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
3956         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3957         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3959         * Makefile: Update from LinuxThreads 0.7.
3960         * internals.h. Likewise.
3961         * manager.c: Likewise.
3962         * mutex.c: Likewise.
3963         * pthread.c: Likewise.
3964         * signals.c: Likewise.
3965         * specific.c: Likewise.
3966         * Examples/ex3.c: Likewise.
3968 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
3970         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3971         open.
3973 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
3975         * wrapsyscall.c: Add socket functions which are also cancelation
3976         points.
3978 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
3980         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
3981         New functions for fast thread specific data within libc.
3983         * internals.h: Add new array p_libc_specific to struct
3984         _pthread_descr_struct.
3986         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
3988 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
3990         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
3991         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
3993 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
3995         * internals.h (struct _pthread_descr_struct): Add definitions for
3996         two-level specific key handling.
3997         * manager.c (pthread_handle_create): Initialize specific memory array.
3998         * specific.c: Implement two-level key handling.
3999         * weaks.c: Don't provide dummy key handling.
4000         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
4001         Add definition of __libc_key_t.
4002         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
4003         as 1024.
4004         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
4005         PTHREAD_DESTRUCTOR_ITERATIONS.
4007         * manager.c (pthread_handle_create): Compare mmap result with
4008         MAP_FAILED.
4010         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
4011         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
4013 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
4015         sysdeps/sparc -> sysdeps/sparc/sparc32
4016         sysdeps/sparc64 -> sysdeps/sparc/sparc64
4018         * internals.h: Change definition of THREAD_SELF to be an expression,
4019         not a statement that did a return.
4020         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
4021         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
4022         Follow Solaris and use a "system reserved" register (%g6) to hold
4023         the thread descriptor.
4024         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
4026 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
4028         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
4029         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
4030         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
4032         * semaphore.c: Include spinlock.h only when needed.
4034         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
4035         keys for entries not in use.
4037         * weaks.c: Implement key handling functions for real.
4039 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
4041         Initial sparc64-linux support:
4042         * sysdeps/sparc64/Implies: New file.
4043         * sysdeps/sparc64/pt-machine.h: Likewise.
4045 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
4047         * semaphore.c: Include spinlock.h at correct place.
4048         Patch by HJ Lu.
4050 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
4052         The Great Bit File Move:
4053         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
4054         * sysdeps/powerpc/semaphorebits.h: Likewise.
4055         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
4056         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
4057         * sysdeps/pthread/libc-lock.h: -> bits/
4058         * sysdeps/pthread/stdio-lock.h: Likewise.
4059         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
4060         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
4061         * semaphore.h: Likewise.
4062         * sysdeps/pthread/pthread.h: Likewise.
4064         * lockfile.c: <foo.h> -> <bits/foo.h>.
4065         * semaphore.h: Likewise.
4067         * Makefile: (headers): foo.h -> bits/foo.h.
4068         * sysdeps/pthread/Makefile: Likewise.
4070 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
4072         * semaphore.c (sem_init): Set sem_spinlock only if available.
4074         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
4075         asm constraints.
4077 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
4079         Update from LinuxThreads 0.6.
4081         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
4082         and __sched_get_priority_min instead of names without `__'.
4084         * manager.c: Rewrite large parts to implement opaque pthread_t.
4086         * cancel.c: Adapt for opaque pthread_t type.
4087         * condvar.c: Likewise.
4088         * errno.c: Likewise.
4089         * join.c: Likewise.
4090         * mutex.c: Likewise.
4091         * pthread.c: Likewise.
4092         * signals.c: Likewise.
4093         * specific.c: Likewise.
4094         * restart.h: Likewise.
4095         * queue.h: Likewise.
4096         * Examples/ex3.c: Likewise.
4097         * Examples/ex4.c: Likewise.
4098         * sysdeps/pthread/pthread.h: Likewise.
4100         * pthread.c: Accumulate time for all threads in thread manager.
4102         * semaphore.c: Implement fallback implementation for architectures
4103         sometimes missing compare-exchange operations.
4105         * cancel.c (pthread_cancel): Validate handle argument.
4106         * join.c (pthread_join): Likewise.
4107         (pthread_detach): Likewise.
4108         * signals.c (pthread_kill): Likewise.
4110         * spinlock.h (acquire): Use __sched_yield not sched_yield.
4112         * queue.h (enqueue): Enqueue thread according to priority.
4114         * internals.c (struct pthread_start_args): New struct for passing
4115         args to cloning function.
4116         (struct _pthread): Rename to _pthread_descr_struct and adapt for
4117         opaque pthread_t.
4119         * Examples/Makefile (clean): Pass -f option to rm.
4121         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
4122         and define TEST_FOR_COMPARE_AND_SWAP.
4123         * sysdeps/i386/i486/pt-machine.h: Removed.
4125         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
4126         to 1024.
4128 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
4130         * restart.h (suspend): Clear p_signal before suspending.
4131         (suspend_with_cancellation): Likewise.
4132         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
4134         * weaks.c: Make __pthread_key_create return 1.
4135         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
4136         __libc_getspecific, __libc_setspecific, and __libc_key_t.
4137         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
4138         using libio.
4140 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
4142         * sysdeps/sparc/pt-machine (RELEASE): Fix.
4144 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
4146         * sysdeps/powerpc/Implies: Added.
4147         * sysdeps/powerpc/pt-machine.h: Added.
4148         * sysdeps/powerpc/semaphorebits.h: Added.
4150 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
4152         * pthread.c (__pthread_initial_thread): Correct
4153         initializer.
4154         (__pthread_manager_thread): Likewise.
4155         Reported by Andreas Jaeger.
4157 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
4159         Since sigset_t no longer fits in a register, we can't pass in the
4160         thread's initial mask so easily.  Take this opportunity to simplify
4161         the clone implementation by only accepting a single void* argument.
4163         * manager.c (__pthread_manager): Put thread vitals in the thread
4164         struct instead of as arguments through clone.
4165         (pthread_start_thread): Look for them there.
4166         * internals.h (struct _pthread): Add p_initial_fn,
4167         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
4168         * pthread.c (pthread_initialize_manager): Revise clone invocation.