Update.
[glibc.git] / linuxthreads / ChangeLog
blob08084a46392092e8794bedd576d31146c35315d9
1 2002-07-29  Steven Munroe  <sjmunroe@us.ibm.com>
3         * shlib-versions: Set libpthread version to 2.3 for powerpc64.
4         * sysdeps/powerpc/pt-machine.h: moved to...
5         * sysdeps/powerpc/powerpc32/pt-machine.h: ...here
6         * sysdeps/powerpc/powerpc64/pt-machine.h: New file. 
8 2002-09-02  Roland McGrath  <roland@redhat.com>
10         * sysdeps/powerpc/Makefile (CFLAGS-pt-initfini.s): New variable.
12 2002-09-01  Roland McGrath  <roland@redhat.com>
14         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t): Add new keys
15         CTYPE_B, CTYPE_TOLOWER, CTYPE_TOUPPER.
17         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_address): New macro.
18         (__libc_internal_tsd_address): Declare it.
19         * Versions (libc, ld, libpthread: GLIBC_PRIVATE): Add
20         __libc_internal_tsd_address.
21         * specific.c (libc_internal_tsd_address): New function.
22         (__libc_internal_tsd_address): New variable.
23         * no-tsd.c (__libc_internal_tsd_address): New variable.
25 2002-08-31  Ulrich Drepper  <drepper@redhat.com>
27         * Makefile: Don't use rule for crt%.o, spell it out as rules for
28         crti.o and crtn.o.
30 2002-08-30  Roland McGrath  <roland@redhat.com>
32         * Makefile (extra-objs, omit-deps): Add crtn.
33         ($(objpfx)libpthread.so): Depend on $(objpfx)crtn.o.
34         ($(objpfx)libpthread.so: +postinit): Append $(objpfx)crtn.o.
35         ($(objpfx)crtn.S): New target.
36         ($(objpfx)crt%.o): Pattern rule replaces crti.o target.
37         (generated): Add crtn.S.
39         * sysdeps/unix/sysv/linux/x86_64/Makefile ($(objpfx)specs): Massage
40         crtn.o pathname too.
42 2002-08-30  Jakub Jelinek  <jakub@redhat.com>
44         * pthread.c (__pthread_initialize_minimal): Call __uselocale even
45         if [! SHARED].
47 2002-08-30  Roland McGrath  <roland@redhat.com>
49         * tst-static-locale.c: New file.
50         * Makefile (tests, tests-static): Add it.
52 2002-04-24  Steven Munroe  <sjmunroe@us.ibm.com>
54         * spinlock.c (__pthread_lock): Fix spurious wakeup
55         handling.  Don't clear lowest bit of list pointer as sign the thread
56         is still on the wait list.  Don't restart after spurious wakeup
57         with spinning to get the lock.
58         (__pthread_unlock): Take set lowest bit into account when handling
59         pointer to list elements.
60         Patch by Steve Munroe <sjmunroe@us.ibm.com>.
62 2002-08-28  Roland McGrath  <roland@redhat.com>
64         * sysdeps/pthread/timer_routines.c (thread_func): Fix type in cast.
66 2002-08-28  Jakub Jelinek  <jakub@redhat.com>
68         * sysdeps/unix/sysv/linux/hppa/aio_cancel.c: New file.
69         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
70         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
72 2002-08-28  Ulrich Drepper  <drepper@redhat.com>
74         * sysdeps/pthread/timer_routines.c (thread_func): Change return
75         type to void and add casts in use to avoid warnings with all gcc
76         versions.
78 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
80         * sysdeps/unix/sysv/linux/bits/local_lim.h (PTHREAD_THREADS_MAX):
81         Bump to 16384.
82         * manager.c (__pthread_handles): Remove.
83         * pthandles.c: New file.
84         * pthread.c (__pthread_initialize_minimal): Initialize
85         __pthread_handles[0] and __pthread_handles[1].
86         * Makefile (libpthread-routines): Add pthandles (must be last).
88 2002-08-26  Brian Youmans  <3diff@gnu.org>
90         * Examples/ex10.c: Corrected version number in Lesser GPL copying
91         permission notice from 2 to 2.1.
92         * Examples/ex11.c: Likewise.
93         * Examples/ex13.c: Likewise.
94         * Examples/ex8.c: Likewise.
95         * Examples/ex9.c: Likewise.
96         * barrier.c: Likewise.
97         * events.c: Likewise.
98         * lockfile.c: Likewise.
99         * no-tsd.c: Likewise.
100         * pt-machine.c: Likewise.
101         * ptclock_gettime.c: Likewise.
102         * ptclock_settime.c: Likewise.
103         * rwlock.c: Likewise.
104         * sysdeps/alpha/pspinlock.c: Likewise.
105         * sysdeps/alpha/pt-machine.h: Likewise.
106         * sysdeps/arm/pspinlock.c: Likewise.
107         * sysdeps/arm/pt-machine.h: Likewise.
108         * sysdeps/cris/pspinlock.c: Likewise.
109         * sysdeps/cris/pt-machine.h: Likewise.
110         * sysdeps/hppa/pspinlock.c: Likewise.
111         * sysdeps/hppa/pt-machine.h: Likewise.
112         * sysdeps/i386/i686/pt-machine.h: Likewise.
113         * sysdeps/i386/pspinlock.c: Likewise.
114         * sysdeps/i386/pt-machine.h: Likewise.
115         * sysdeps/i386/useldt.h: Likewise.
116         * sysdeps/ia64/pspinlock.c: Likewise.
117         * sysdeps/ia64/pt-machine.h: Likewise.
118         * sysdeps/m68k/pspinlock.c: Likewise.
119         * sysdeps/m68k/pt-machine.h: Likewise.
120         * sysdeps/mips/pspinlock.c: Likewise.
121         * sysdeps/mips/pt-machine.h: Likewise.
122         * sysdeps/powerpc/pspinlock.c: Likewise.
123         * sysdeps/powerpc/pt-machine.h: Likewise.
124         * sysdeps/pthread/bits/initspin.h: Likewise.
125         * sysdeps/pthread/bits/libc-lock.h: Likewise.
126         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
127         * sysdeps/pthread/getcpuclockid.c: Likewise.
128         * sysdeps/pthread/posix-timer.h: Likewise.
129         * sysdeps/pthread/timer_create.c: Likewise.
130         * sysdeps/pthread/timer_delete.c: Likewise.
131         * sysdeps/pthread/timer_getoverr.c: Likewise.
132         * sysdeps/pthread/timer_gettime.c: Likewise.
133         * sysdeps/pthread/timer_routines.c: Likewise.
134         * sysdeps/pthread/timer_settime.c: Likewise.
135         * sysdeps/pthread/tst-timer.c: Likewise.
136         * sysdeps/s390/pspinlock.c: Likewise.
137         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
138         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
139         * sysdeps/sh/pspinlock.c: Likewise.
140         * sysdeps/sh/pt-machine.h: Likewise.
141         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
142         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
143         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
144         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
145         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
146         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
147         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
148         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
149         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
150         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
151         * tststack.c: Likewise.
152         * unload.c: Likewise.
153         * weaks.c: Likewise.
154         * wrapsyscall.c: Likewise.
156         * sysdeps/pthread/pt-initfini.c: Changed copying
157         permission notice to Lesser GPL from Library GPL, including the
158         references in the special exception.
159         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: Likewise.
160         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Likewise.
161         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c:
162         Likewise.
163         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c:
164         Likewise.
165         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Likewise.
167 2002-08-26  Ulrich Drepper  <drepper@redhat.com>
169         * Examples/ex10.c (thread): tv_nsec == 1000000000 is already
170         overflow [PR libc/4244].
172 2002-08-25  Ulrich Drepper  <drepper@redhat.com>
174         * sysdeps/pthread/timer_routines.c (thread_func): Make the
175         compiler happy by adding a return statement which will never be
176         reached.
178         * tst-context.c (main): Cast to long before casting to pointer.
180         * Examples/ex17.c (main): Use correct format string.
182         * Examples/ex9.c (thread): Remove incorrect return statement.
184 2002-08-23  Ulrich Drepper  <drepper@redhat.com>
186         * pthread.c (__linuxthreads_version): New global constant.
188 2002-08-23  Andreas Jaeger  <aj@suse.de>
190         * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
191         as thread specific register.
192         (testandset): Fix inline asm.
193         (THREAD_GETMEM): Fix inline asm.
195 2002-08-22  Roland McGrath  <roland@redhat.com>
197         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
198         conditional.
199         (INIT_THREAD_SELF): Pass second arg to DO_SET_THREAD_AREA.
200         (DO_SET_THREAD_AREA): Take second arg, pass to DO_SET_THREAD_AREA_REUSE
201         macro.  That chooses whether to reuse %gs value or let kernel set it.
202         [USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, always 1.
203         [!USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, true if arg is
204         not constant 0.
206 2002-08-21  Ulrich Drepper  <drepper@redhat.com>
208         * sysdeps/i386/tls.h (TLS_SETUP_GS_SEGMENT): Add new parameter
209         also to the third definition of this macro.
211 2002-06-17  Andreas Jaeger  <aj@suse.de>
213         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
214         Set it.
216 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
218         * sysdeps/i386/useldt.h: Go back to using 16-bit instructions when
219         loading/reading segment registers.  Some old hardware doesn't
220         handle the 32-bit instructions as expected.
221         * sysdeps/i386/tls.h: Likewise.
223         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
224         renamed to secondcall and use is negated.
225         (TLS_SETUP_GS_SEGMENT): Likewise.
226         (TLS_INIT_TP): Likewise.
227         * sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
228         secondcall.
230         * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
231         registers.  No need to mask upper 16 bits in this case.
232         * sysdeps/i386/useldt.h: Likewise.
233         (DO_SET_THREAD_AREA): We have to load %gs again even if the value
234         is the same since the GDT content changed.
236         * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
237         to TLS_SETUP_GS_SEGMENT.
238         (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
239         TLS_DO_SET_THREAD_AREA.
240         (TLS_DO_SET_THREAD_AREA): If new parameter is zero determine
241         entry number from %gs value.
242         * sysdeps/sh/tls.h (TLS_INIT_TP): Add new parameter and simply
243         ignore it.
245         * manager.c (pthread_handle_create): Pass NULL to _dl_allocate_tls.
246         Pass true to _dl_deallocate_tls.
247         (pthread_free): Likewise.
248         * pthread.c (__pthread_initialize_manager): Likewise.
250 2002-08-19  Ulrich Drepper  <drepper@redhat.com>
252         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Use correct shift when
253         computing index from %gs value.
255 2002-08-16  Roland McGrath  <roland@redhat.com>
257         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Calculate segment
258         register value from entry number properly.
260         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Rewrite asm to use %ebx
261         optimally conditional on [__PIC__].
262         (TLS_DO_SET_THREAD_AREA): New macro, implement inline syscall
263         without touching errno, and use latest modify_ldt-like interface.
264         (TLS_SETUP_GS_SEGMENT): Use that instead of INLINE_SYSCALL.
265         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Set %gs in this macro.
266         (DO_SET_THREAD_AREA): New macro, uses current syscall interface with
267         existing %gs value as the segment to set.
268         (INIT_THREAD_SELF): Rewritten using those.  Use set_thread_area only
269         under [HAVE_TLS_SUPPORT] so we can rely on the initialization done
270         by the first thread's early TLS setup.
272 2002-08-15  Roland McGrath  <roland@redhat.com>
274         * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
275         return a value as callers now expect.
277 2002-08-11  Roland McGrath  <roland@redhat.com>
279         * pthread.c (__pthread_initialize_manager): Initialize
280         p_header.data.tcb field of manager thread's descriptor.
281         (__pthread_initialize_minimal): Don't initialize p_header.data.self
282         field, already done by TLS_INIT_TP.
284         * manager.c (pthread_handle_create): Move p_header field initializers
285         together.
287 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
289         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
291 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
293         * pthread.c (__linuxthreads_initial_report_events): New variable.
294         (__pthread_initialize_manager): Use it to initialize p_report_events
295         of initial thread.
296         [TLS]: Store pointer to descriptor of manager in __pthread_handles.
298 2002-08-07  Roland McGrath  <roland@redhat.com>
300         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Add an extra argument with
301         an "m" constraint to the asm so the compiler knows LDT_ENTRY was used.
303 2002-08-02  Roland McGrath  <roland@redhat.com>
305         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t):
306         Add _LIBC_TSD_KEY_LOCALE.
307         * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
308         Call __uselocale to initialize our per-thread locale pointer to
309         the global one.
310         * pthread.c (__pthread_initialize_minimal): Likewise.
312         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Add missing \s.
314 2002-08-02  Ulrich Drepper  <drepper@redhat.com>
316         * pthread.c: Declare _errno, _h_errno, and _res unless we use TLS
317         internally.
319         * cancel.c (__pthread_perform_cleanup) [USE_TLS && HAVE___THREAD]:
320         Don't use p_libc_specific element in thread descriptor.
322 2002-07-30  Roland McGrath  <roland@redhat.com>
324         * sysdeps/pthread/bits/libc-tsd.h: Include <tls.h>.
325         [USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
326         which does the right thing when __thread support is available.
327         * descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
328         Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
329         `p_h_errno', `p_resp', and `p_res' members.
330         * pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
331         Don't initialize `p_errnop' and `p_h_errnop' members.
332         (__pthread_reset_main_thread): Likewise.
333         (__pthread_initialize_manager): Likewise.
334         * manager.c (__pthread_manager, pthread_handle_create): Likewise.
335         * pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
336         Don't initialize `p_resp' member.
337         (__pthread_reset_main_thread): Likewise.
338         * manager.c (pthread_handle_create): Likewise.
339         * specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
340         Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
341         * no-tsd.c: Conditionalize contents on [!(USE_TLS && HAVE___THREAD)].
342         * errno.c [USE_TLS && HAVE___THREAD]
343         (__h_errno_location, __res_state): Don't define these at all.
345         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
346         (INSTALL_NEW_DTV, GET_DTV): Likewise.
347         * sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
349         * weaks.c: Don't include <errno.h> here.
351 2002-08-01  Roland McGrath  <roland@redhat.com>
353         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
354         TLS_INIT_TP.
355         (TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
356         (TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
357         (TLS_INIT_TP): Use that.
359 2002-08-02  Jakub Jelinek  <jakub@redhat.com>
361         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Move from INIT_THREAD_SELF.
362         (INIT_THREAD_SELF): Use sys_thread_area syscall instead if available.
363         (FREE_THREAD): Avoid modify_ldt if using GDT.
364         * sysdeps/i386/pspinlock.c (__have_no_set_thread_area): New variable.
366 2002-07-25  Jakub Jelinek  <jakub@redhat.com>
368         * sysdeps/i386/tls.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
369         * sysdeps/i386/pt-machine.h: Likewise.
370         * sysdeps/i386/useldt.h: Likewise.
372 2002-07-22  Ulrich Drepper  <drepper@redhat.com>
374         * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
375         call __libc_setup_tls first.
376         * Makefile: Actually create tst-signal.out file when running the test.
377         (tests): Add tststatic.
378         * Examples/tststatic.c: New file.
380 2002-07-19  Ulrich Drepper  <drepper@redhat.com>
382         * errno.c (__errno_location): Don't define unless !USE_TLS
383         || !HAVE___THREAD.
384         * sysdeps/i386/pt-machine.c: Protect C code with #ifndef ASSEMBLER.
385         * sysdeps/i386/tls.h: Likewise.
386         * sysdeps/i386/useldt.h: Likewise.
387         * sysdeps/i386/i686/pt-machine.h: Likewise.
389 2002-07-02  H.J. Lu  <hjl@gnu.org>
391         * sysdeps/mips/pspinlock.c: Don't include <sgidefs.h>.  Always
392         use ll/sc.
393         * sysdeps/mips/pt-machine.h: Likewise.
395 2002-07-14  Ulrich Drepper  <drepper@redhat.com>
397         * manager.c (pthread_handle_create): Initialize self-reference in
398         descriptor.
400 2002-07-01  Jakub Jelinek  <jakub@redhat.com>
402         * Examples/ex9.c (main): Remove unused th variable.
404 2002-07-10  Ulrich Drepper  <drepper@redhat.com>
406         * wrapsyscall.c: Add __nanosleep alias.
407         * Versions (GLIBC_2.2.6): Add __nanosleep.
408         * bug-sleep.c: New file.
409         * Makefile (tests): Add bug-sleep.
411 2002-06-19  Steven Munroe  <sjmunroe@vnet.ibm.com>
413         * Examples/ex9.c (main):  Use list of children and join them.
414         (thread): Do not call exit.
416 2002-06-20  Ulrich Drepper  <drepper@redhat.com>
418         * spinlock.c (wait_node_alloc): We cannot use compare-and-exchange.
419         Unconditionally use the code using spinlock.  Use __pthread_release
420         to free a spinlock.
421         (wait_node_free): Likewise.
422         (__pthread_acquire, __pthread_release): Unconditionally define.
424 2002-06-07  Jakub Jelinek  <jakub@redhat.com>
426         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Fix typo.
428 2002-05-24  Ulrich Drepper  <drepper@redhat.com>
430         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Use __sync_synchronize.
432 2002-05-21  Ulrich Drepper  <drepper@redhat.com>
434         * sysdeps/pthread/pthread.h (pthread_create): Rename first
435         parameter.
436         (pthread_cancel): Likewise.
437         * internals.h (__pthread_create_2_1): Likewise.
438         * sysdeps/unix/sysv/linux/bits/sigthread.h (pthread_kill): Likewise.
440 2002-05-20  Ulrich Drepper  <drepper@redhat.com>
442         * sysdeps/alpha/pt-machine.c (THREAD_SELF): Remove clobber.
443         Patch by Glen Nakamura <gen@flex.com>.
445 2002-05-03  Ulrich Drepper  <drepper@redhat.com>
447         * signals.c: Move sighandler functions to...
448         * sighandler.c: ...here.  New file.
449         * signals.c: Move signal handler related type definitions to...
450         * internals.h: ...here.  Add prototypes for signal handlers.
451         * Makefile (libpthread-routines): Add sighandler.
452         (CFLAGS-sighandler.c): Add $(exceptions).
454 2002-04-30  Jakub Jelinek  <jakub@redhat.com>
456         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
458 2002-04-08  Ulrich Drepper  <drepper@redhat.com>
460         * sysdeps/pthread/timer_getoverr.c: Return real overrun.
461         * sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
462         * sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
463         based on previous one and not on current time.  Count overruns.
464         Patch by Eric F. Sorton <eric@cctcorp.com>.
466         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
468 2002-04-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
470         * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
471         if it isn't defined yet.
472         (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
473         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
474         Likewise.
475         * sysdeps/sh/tls.h: New file.
477 2002-04-08  Jakub Jelinek  <jakub@redhat.com>
479         * manager.c (__pthread_manager_event): Use self instead of arg
480         for INIT_THREAD_SELF.
481         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct
482         _pthread_descr_struct) instead of sizeof (*descr).
484 2002-04-05  Ulrich Drepper  <drepper@redhat.com>
486         * sysdeps/ia64/pt-machine.h: Protect against multiple inclusion.
487         * sysdeps/alpha/pt-machine.h: Likewise.
488         * sysdeps/arm/pt-machine.h: Likewise.
489         * sysdeps/cris/pt-machine.h: Likewise.
490         * sysdeps/hppa/pt-machine.h: Likewise.
491         * sysdeps/m68k/pt-machine.h: Likewise.
492         * sysdeps/mips/pt-machine.h: Likewise.
493         * sysdeps/powerpc/pt-machine.h: Likewise.
494         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
495         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
496         * sysdeps/sh/pt-machine.h: Likewise.
497         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
498         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
499         * sysdeps/x86_64/pt-machine.h: Likewise.
501 2002-04-05  Jakub Jelinek  <jakub@redhat.com>
503         * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document
504         instead of pthread_mutexattr_setkind_np.
505         (pthread_mutexattr_gettype): Similarly.
506         * man/pthread_mutexattr_setkind_np.man: New.
507         * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man.
509 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
511         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Define.
513 2002-03-22  Jakub Jelinek  <jakub@redhat.com>
515         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Remove.
517 2002-03-22  Ulrich Drepper  <drepper@redhat.com>
519         * internals.h (MEMORY_BARRIER): Define as asm with memory as clobber.
521 2002-03-17  Andreas Jaeger  <aj@suse.de>
523         * sysdeps/i386/pt-machine.h: Add testandset and __compare_and_swap
524         prototpyes.
525         * sysdeps/alpha/pt-machine.h: Likewise.
526         * sysdeps/arm/pt-machine.h: Likewise.
527         * sysdeps/cris/pt-machine.h: Likewise.
528         * sysdeps/hppa/pt-machine.h: Likewise.
529         * sysdeps/i386/i686/pt-machine.h: Likewise.
530         * sysdeps/ia64/pt-machine.h: Likewise.
531         * sysdeps/m68k/pt-machine.h: Likewise.
532         * sysdeps/mips/pt-machine.h: Likewise.
533         * sysdeps/powerpc/pt-machine.h: Likewise.
534         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
535         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
536         * sysdeps/sh/pt-machine.h: Likewise.
537         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
538         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
539         * sysdeps/x86_64/pt-machine.h: Likewise.
541         * internals.h: Move testandset and __compare_and_swap prototypes
542         to pt-machine.h.
544 2002-03-03  Andreas Jaeger  <aj@suse.de>
546         * errno.c: Include resolv.h to avoid warning.
548 2002-02-27  Ulrich Drepper  <drepper@redhat.com>
550         * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
551         stack limit.
553 2002-02-23  Ulrich Drepper  <drepper@redhat.com>
555         * attr.c (pthread_getattr_np): Don't take thread descriptor size
556         into account if USE_TLS.
557         * manager.c (pthread_handle_create): Free TLS data structures if call
558         failed.  Pass correct stack to clone if USE_TLS.
559         * sysdeps/i386/pt-machine.h: Handle multiple inclusion.
560         * sysdeps/i386/i686/pt-machine.h: Likewise.
561         * sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
563         * descr.h (struct _pthread_descr_struct): Update p_header for TLS.
564         Add p_stackaddr element #if USE_TLS.
565         * internals.c: Include <tls.h>.
566         * manager.c: Integrate creating and handling of thread descriptor
567         for TLS.
568         * pthread.c: Likewise.
569         * sysdeps/i386/tls.h (tcbhead_t): Add self pointer.
570         Include <linuxthreads/descr.h> only if TLS is really used.
571         (GET_DTV): New macro.
572         (TLS_INIT_TP): Initialize self pointer.
574 2002-02-17  Andreas Schwab  <schwab@suse.de>
576         * signals.c (sigwait): Check for old sighandler being SIG_ERR,
577         not NULL.
579 2002-02-12  Ulrich Drepper  <drepper@redhat.com>
581         * sysdeps/i386/tls.c (INSTALL_NEW_DTV): Define.
582         (INSTALL_DTV): Adjust for being passed pointer to element with length.
584 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
586         * sysdeps/i386/tls.h (TLS_INIT_TP): Also initialize %gs.
588 2002-02-08  Richard Henderson  <rth@redhat.com>
590         * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string.
592 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
594         * sysdeps/i386/tls.h: TLS cannot be supported with FLOATING_STACKS
595         after all.
597 2002-02-07  H.J. Lu  <hjl@gnu.org>
599         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Silence the
600         gcc warning.
601         (__pthread_spin_lock): Remove ".set noreorder".
602         * sysdeps/mips/pt-machine.h (__compare_and_swap): Liekwise.
604 2002-02-05  H.J. Lu  <hjl@gnu.org>
606         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Not use
607         branch likely.
608         * sysdeps/mips/pt-machine.h (testandset): Likewise.
609         (__compare_and_swap): Likewise.
611 2002-02-07  Ulrich Drepper  <drepper@redhat.com>
613         * internals.h: Move declarations/definitions of
614         __pthread_initial_thread_bos, __pthread_initial_thread,
615         __pthread_manager_thread_bos, __pthread_manager_thread_tos,
616         __pthread_manager_thread, __pthread_nonstandard_stacks, STACK_SIZE,
617         CURRENT_STACK_FRAME, __pthread_find_self, and thread_self...
618         * descr.h: ...here.
619         * sysdeps/i386/tls.h: Add TLS definitions also for !FLOATING_STACKS.
620         Define THREAD_GETMEM accordingly.
622 2002-02-06  Ulrich Drepper  <drepper@redhat.com>
624         * sysdeps/i386/tls.h: Include <stddef.h> for size_t.
626         * sysdeps/i386/tls.h: Define THREAD_DTV.
628 2002-02-04  Ulrich Drepper  <drepper@redhat.com>
630         * internals.h: Move thread descriptor definition...
631         * descr.h.: ...here.  New file.
632         * sysdeps/i386/tls.h: New file.
634 2002-02-01  H.J. Lu  <hjl@gnu.org>
636         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Use a
637         different register in the delayed slot.  Use branch likely.
639         * sysdeps/mips/pt-machine.h (testandset): Call _test_and_set.
640         (__compare_and_swap): Return 0 only when failed to compare. Use
641         branch likely.
643 2002-02-01  Jakub Jelinek  <jakub@redhat.com>
645         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set,
646         __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE.
647         * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE.
648         * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE.
649         * sysdeps/sparc/sparc32/sparcv9/Versions: New file.
650         * sysdeps/sparc/sparc64/Versions: New file.
651         * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE.
653 2002-01-31  Ulrich Drepper  <drepper@redhat.com>
655         * pthread.c: _dl_cpuclock_offset is not any longer a global variable
656         in SHARED code, use GL(dl_cpuclock_offset).
658 2002-01-28  Andreas Jaeger  <aj@suse.de>
660         * sysdeps/mips/pspinlock.c (__pthread_spin_init): Clear *LOCK to
661         0. Patch by Machida Hiroyuki <machida@sm.sony.co.jp>.
663 2002-01-16  Martin Schwidefsky  <schwidefsky@de.ibm.com>
665         * sysdeps/s390/s390-32/pt-machine.h (MEMORY_BARRIER): Define.
666         (CURRENT_STACK_FRAME): Remove duplicate definition.
667         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
669 2002-01-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
671         * Makefile (CFLAGS-tst-cancel.c): Add -fno-inline-functions to prevent
672         automatic inline.
674 2002-01-12  Andreas Schwab  <schwab@suse.de>
676         * Makefile (test-srcs): Add tst-signal.
677         (tests): Run tst-signal.
678         (distribute): Add tst-signal.sh.
679         * tst-signal.c, tst-signal.sh: New files.
681 2002-01-14  Andreas Jaeger  <aj@suse.de>
683         * sysdeps/x86_64/pt-machine.h (INIT_THREAD_SELF): Avoid warning.
685 2002-01-11  Andreas Schwab  <schwab@suse.de>
687         * signals.c (sighandler): Initialize all elements to SIG_ERR.
688         (__sigaction): Don't use value from sighandler if it is SIG_ERR.
690 2002-01-06  Richard Henderson  <rth@redhat.com>
692         * sysdeps/alpha/elf/pt-initfini.c: New file.
694 2001-12-29  Andreas Jaeger  <aj@suse.de>
696         * Examples/ex9.c: Add noreturn attribute for thread.
697         * Examples/ex10.c: Likewise.
698         * Examples/ex13.c (thread_start): Likewise.
699         * Examples/ex15.c (worker): Likewise.
701         * Examples/ex18.c: Include unistd.h for prototype of sleep.
703 2001-12-14  Ulrich Drepper  <drepper@redhat.com>
705         * man/pthread_atfork.man: Adjust description of mutex handling
706         after fork for current implementation.
707         * linuxthreads.texi: Likewise [PR libc/2519].
709 2001-12-13  Andreas Schwab  <schwab@suse.de>
711         * specific.c (pthread_key_delete): Don't contact the thread
712         manager if no threads have been created yet.
714 2001-12-12  NIIBE Yutaka  <gniibe@m17n.org>
716         * sysdeps/sh/pt-machine.h (INIT_THREAD_SELF): Added __volatile__
717         qualifier to be safe.
719 2001-11-30  Andreas Schwab  <schwab@suse.de>
721         * pthread.c (pthread_handle_sigcancel) [THREAD_SELF]: Double check
722         that self is the manager thread, and initialize the thread
723         register if not.
724         (thread_self_stack) [THREAD_SELF]: New function to find self via
725         stack pointer.
726         * manager.c (pthread_handle_create): Don't block cancel signal any
727         more.
729 2001-11-29  Andreas Jaeger  <aj@suse.de>
731         * sysdeps/x86_64/pt-machine.h: Use %gs as thread specific register.
732         (THREAD_SELF): New.
733         (INIT_THREAD_SELF): New.
734         (THREAD_GETMEM): New.
735         (THREAD_GETMEM_NC):
736         (THREAD_SETMEM): New.
737         (THREAD_SETMEM_NC): New.
738         (FLOATING_STACKS): Define.
739         (ARCH_STACK_MAX_SIZE): Define.
741 2001-11-28  Kaz Kylheku  <kaz@ashi.footprints.net>
743         Bugfix to pthread_key_delete. It was iterating over the thread
744         manager's linked list of threads, behind the thread manager's
745         back causing a race. The fix is to have the manager iterate over
746         the threads instead, using a new request type for doing so.
747         * internals.h (struct pthread_request): New manager request type
748         REQ_FOR_EACH_THREAD.
749         * manager.c (pthread_for_each_thread): New function.
750         (__pthread_manager): Handle new REQ_FOR_EACH_THREAD request.
751         * specific.c (struct pthread_key_delete_helper_args): New type.
752         (pthread_key_delete_helper): New static function.
753         (pthread_key_delete): Use the new thread manager
754         REQ_FOR_EACH_THREAD function to iterate over the threads and set
755         the delete key slot to a null value in each thread.
756         * Examples/ex18.c: New test.
757         * Makefile (tests): Add ex18.
759 2001-11-22  Wolfram Gloger  <wg@malloc.de>
761         * pthread.c (pthread_onexit_process): Don't call free
762         after threads have been asynchronously terminated.
764         * manager.c (pthread_handle_exit): Surround cancellation
765         of threads with __flockfilelist()/__funlockfilelist().
767 2001-11-26  Andreas Schwab  <schwab@suse.de>
769         * manager.c (pthread_handle_create): Start the child thread with
770         the cancel signal blocked, so that it does not handle it before
771         the thread register is set up.  Save errno from failed clone call.
773 2001-11-15  Ulrich Drepper  <drepper@redhat.com>
775         * sysdeps/i386/i686/Implies: Removed.
776         * sysdeps/i386/i686/Versions: New file.
778 2001-10-31  Andreas Jaeger  <aj@suse.de>
780         * sysdeps/x86_64/Makefile: Remove, we do not need it anymore.
782 2001-10-05  Kevin Buettner  <kevinb@cygnus.com>
784         * pthread.c (__linuxthread_pthread_sizeof_descr): Change name
785         to __linuxthreads_pthread_sizeof_descr to match name used by
786         symbol_list_arr[LINUXTHREADS_PTHREAD_SIZEOF_DESCR] in
787         linuxthreads_db/td_symbol_list.c.
789 2001-09-22  Andreas Jaeger  <aj@suse.de>
791         * linuxthreads/tst-context.c: Avoid compile warning.
793 2001-09-20  Andreas Jaeger  <aj@suse.de>
795         * shlib-versions: Add x86-64.
797 2001-09-19  Andreas Jaeger  <aj@suse.de>
799         * sysdeps/x86_64/Makefile: New file.
800         * sysdeps/x86_64/pspinlock.c: New file.
801         * sysdeps/x86_64/pt-machine.h: New file.
803 2001-09-12  Jakub Jelinek  <jakub@redhat.com>
805         * sysdeps/pthread/timer_delete.c (timer_delete): Thread may be NULL
806         for SIGEV_NONE.
807         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
809 2001-09-11  Ulrich Drepper  <drepper@redhat.com>
810             Wolfram Gloger <wg@malloc.de>
812         * join.c: Protect all communications from and to manager with
813         TEMP_FAILURE_RETRY.
814         * manager.c: Likewise.
815         * pthread.c: Likewise.
816         * smeaphore.c: Likewise.
818 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
820         * spinlock.c (__pthread_lock): Top max_count value with
821         MAX_ADAPTIVE_SPIN_COUNT.
822         * internals.h (MAX_ADAPTIVE_SPIN_COUNT): Define if not already done.
824         * sysdeps/i386/i686/pt-machine.h (BUSY_WAIT_NOP): New macro to
825         help P4.
827 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
829         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
830         non-opaque type if __USE_UNIX98.
832 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
834         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
835         non-opaque lock types also if _IO_MTSAFE_IO is defined.
837 2001-08-23  Roland McGrath  <roland@frob.com>
839         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start): Take
840         new first argument, skip the cleanup handler if it's zero.
841         (_LIBC_LOCK_RECURSIVE_INITIALIZER): New macro.
842         (__libc_lock_define_initialized_recursive): Use it.
843         * sysdeps/pthread/bits/stdio-lock.h: File removed.
844         The sysdeps/generic file from the main tree now suffices.
846 2001-08-22  Roland McGrath  <roland@frob.com>
848         * sysdeps/pthread/bits/stdio-lock.h: Include <bits/libc-lock.h>
849         instead of <pthread.h>.
850         (_IO_lock_t): Define this typedef using __libc_lock_define_recursive.
851         (_IO_lock_initializer): Add braces.
852         (_IO_lock_lock): Use __libc_lock_lock_recursive.
853         (_IO_lock_unlock): Use __libc_lock_unlock_recursive.
855         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_recursive_t): New type.
856         (__libc_lock_define_initialized_recursive): Use it.
857         (__libc_lock_init_recursive): Likewise.
858         (__libc_lock_fini_recursive): Likewise.
859         (__libc_lock_lock_recursive): Likewise.
860         (__libc_lock_trylock_recursive): Likewise.
861         (__libc_lock_unlock_recursive): Likewise.
862         (__libc_lock_define_recursive): New macro.
864 2001-08-14  Jakub Jelinek  <jakub@redhat.com>
866         * lockfile.c (__pthread_provide_lockfile): New variable.
867         * pthread.c (__pthread_require_lockfile): New variable.
868         * cancel.c (__pthread_require_lockfile): New variable.
870 2001-07-31  Ulrich Drepper  <drepper@redhat.com>
872         * tst-context.c (threadfct): Initialize context before calling
873         makecontext.
875         * Examples/ex17.c: Make sure test thread is around long enough.
877 2001-07-26  kaz Kojima  <kkojima@rr.iij4u.or.jp>
879         * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
881 2001-07-24  Ulrich Drepper  <drepper@redhat.com>
883         * tst-context.c (main): Print explanation before bailing out
884         because context handling is not supported.
886 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
888         * Makefile (tests): Add tst-context.
889         * tst-context.c: New file.
891         * sysdeps/pthread/bits/stdio-lock.h: Define
892         _IO_cleanup_region_start_noarg.
894 2001-07-23  Jakub Jelinek  <jakub@redhat.com>
896         * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
897         (ARCH_STACK_MAX_SIZE): Define.
898         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
899         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
901 2001-07-19  Jakub Jelinek  <jakub@redhat.com>
903         * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
905         * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
906         (ARCH_STACK_MAX_SIZE): Define.
907         * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
908         NEED_SEPARATE_REGISTER_STACK.
910 2001-07-16  Andreas Schwab  <schwab@suse.de>
912         * Makefile (before-compile): Don't add $(objpfx)crti.o.
913         (omit-deps): Add crti.
914         ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
915         it is filtered out of the link command.
917 2001-07-16  Ulrich Drepper  <drepper@redhat.com>
919         * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
920         to find the right value for __pthread_initial_thread_bos, it's not
921         used.  If not FLOATING_STACKS first run
922         __pthread_init_max_stacksize.
924 2001-06-16  H.J. Lu  <hjl@gnu.org>
926         * internals.h: Include <stackinfo.h>.
928         * attr.c: Don't include <stackinfo.h> here.
929         * cancel.c: Likewise.
930         * manager.c: Likewise.
931         * pthread.c: Likewise.
932         * ptlongjmp.c: Likewise.
934 2001-03-23  Matthew Wilcox  <willy@ldl.fc.hp.com>
936         * attr.c: Make _STACK_GROWS_UP work.
937         * internals.h: Likewise.
938         * manager.c: Likewise.
939         * pthread.c: Likewise.
941 2001-06-15  H.J. Lu  <hjl@gnu.org>
943         * pthread.c (__pthread_reset_main_thread): Fix a typo.
945 2001-02-02  John S. Marvin  <jsm@udlkern.fc.hp.com>
947         * semaphore.h: Use struct _pthread_fastlock as an element of
948         sem_t instead of an identical struct.
949         * rwlock.c: Remove casts.
950         * semaphore.c: Likewise.
952 2001-04-30  Alan Modra  <amodra@one.net.au>
954         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
956 2001-05-25  Bruce Mitchener  <bruce@cubik.org>
958         * linuxthreads.texi: Spelling corrections.
960 2001-05-25  Ulrich Drepper  <drepper@redhat.com>
962         * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
963         returning successfully.
964         Patch by Gene Cooperman <gene@ccs.neu.edu>.
966 2001-05-24  Ulrich Drepper  <drepper@redhat.com>
968         * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
969         serious work try once whether the lock is uncontested.
970         Remove duplicate reading of __status before loop.
971         Change suggested by Hans Boehm <hans_boehm@hp.com>.
973         * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
974         (__pthread_alt_trylock): Likewise.
976 2001-05-01  Kaz Kylheku  <kaz@ashi.footprints.net>
978         Memory barrier overhaul following line by line inspection.
979         * mutex.c (pthread_once): Missing memory barriers added.
980         * pthread.c (__pthread_wait_for_restart_signal,
981         __pthread_timedsuspend_new, __pthread_restart_new): Added
982         memory barriers ``just in case'' and for documentary value.
983         * spinlock.c (__pthread_release): New inline function for releasing
984         spinlock, to complement __pthread_acquire.  Includes memory
985         barrier prior to assignment to spinlock, and __asm __volatile
986         dance to prevent reordering or optimization of the spinlock access.
987         * spinlock.c (__pthread_unlock, __pthread_alt_lock,
988         __pthread_alt_timedlock, __pthread_alt_unlock,
989         __pthread_compare_and_swap): Updated to use new __pthread_release
990         instead of updating spinlock directly.
991         * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
992         wait_node_free, wait_node_dequeue, __pthread_alt_lock,
993         __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
994         Memory barrier overhaul.  Lots of missing memory barriers added,
995         a couple needless ones removed.
996         * spinlock.c (__pthread_compare_and_swap): testandset optimization
997         removed, just calls __pthread_acquire, which has the new read
998         barrier in it before its testandset.
1000 2001-05-20  Roland McGrath  <roland@frob.com>
1002         * Makeconfig: New file, variables used to be in main libc Makeconfig.
1004 2001-05-09  Geoff Keating  <geoffk@redhat.com>
1006         * sysdeps/powerpc/pt-machine.h
1007         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
1008         (__compare_and_swap): Remove memory barriers.
1009         (__compare_and_swap_with_release_semantics): New function.
1011 2001-04-24  Andreas Jaeger  <aj@suse.de>
1013         * wrapsyscall.c: send* and recv* return ssize_t.
1015         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
1016         mutex instead of double locking it.
1017         Reported by Pierre Artaud <partaud@sodatec.com>.
1019 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
1021         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
1022         using #ifdef whether the clock is available.
1023         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
1025         * sysdeps/ia64/Versions: New file.
1027         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
1028         have to call __gmon_start__ in the libpthread DSO.
1029         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
1031         * Makefile (libpthread-routines): Add ptclock_gettime and
1032         ptclock_settime.
1033         * internals.h: Don't use cpuclock-init.h definitions, use
1034         hp-timing.h definitions.
1035         * pthread.c: Likewise.
1036         * manager.c: Likewise.
1037         * ptclock_gettime.c: New file.
1038         * ptclock_settime.c: New file.
1039         * internals.h: Fix parameter type for __pthread_clock_gettime and
1040         __pthread_clock_settime.
1042         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
1043         * sysdeps/i386/i586/ptclock_settime.c: Removed.
1044         * sysdeps/i386/i586/Makefile: Removed.
1046 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
1048         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
1049         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1051 2001-04-21  Andreas Jaeger  <aj@suse.de>
1053         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
1054         attribute, remove statements that will never be executed.
1055         (thread_func): Remove mutex_unlock call since it's never executed.
1056         (thread_func): Fix comment as suggested by Jakub Jelinek.
1058         * manager.c (__pthread_manager): Add noreturn
1059         attribute.
1060         (pthread_start_thread): Likewise, remove return statement.
1061         (pthread_start_thread_event): Likewise.
1062         Add noreturn attribute for pthread_handle_exit.
1063         * weaks.c: Add noreturn attribute for pthread_exit.
1065         * internals.h: Add __pthread_clock_gettime and
1066         __pthread_clock_settime prototypes.
1068 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
1070         * internals.h: Include <cpuclock-init.h>.
1071         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
1072         CPUCLOCK_VARDEF is defined.
1073         * pthread.c (__pthread_initialize_minimal): Initialize
1074         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
1075         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
1076         for new thread to current CPU clock value.
1078         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
1080         * sysdeps/i386/i586/Makefile: New file.
1081         * sysdeps/i386/i586/Versions: New file.
1082         * sysdeps/i386/i586/ptclock_gettime.c: New file.
1083         * sysdeps/i386/i586/ptclock_settime.c: New file.
1084         * sysdeps/i386/i686/Implies: New file.
1086 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1088         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
1089         $generated, not $postclean-generated.
1091 2001-04-18  Andreas Jaeger  <aj@suse.de>
1093         * Makefile (otherlibs): Added.
1095 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1097         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1099 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
1101         * signals.c (sigwait): NSIG is no signal number.  Block all
1102         signals while in signal handler for signals in SET.
1103         Patch by Manfred Spraul <manfred@colorfullife.com>.
1105 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
1107         * tst-cancel.c: Disable most tests.  Add new test where all
1108         cleanup handlers must run.
1109         * Makefile (tests): Add tst-cancel again.
1111         * cancel.c (__pthread_perform_cleanup): Correct condition for
1112         leaving cleanup loop early.
1114         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
1115         all the files which use CURRENT_STACK_FRAME.
1116         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
1117         __builtin_frame_address.
1118         * sysdeps/i386/i686/pt-machine.h: Likewise.
1120 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1122         * Makefile (tests): Comment out tst-cancel for now.
1124         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
1125         temporary file in object directory.
1126         * Makefile: Don't allow inlining when compiling tst-cancel.c.
1127         Pass $(objpfx) to tst-cancel.
1129 2001-04-11  David S. Miller  <davem@redhat.com>
1131         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
1132         up closer to user local variables so that new cleanup heuristics work.
1133         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
1135 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1137         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
1138         and remove it.
1139         (_pthread_cleanup_push_defer): Likewise.
1141         * tst-cancel.c (main): Fix loop printing cleanup output.
1143 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1145         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
1146         test.
1147         (__pthread_spin_trylock): Likewise.
1148         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1150 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
1152         * join.c (pthread_exit): Move code to new function __pthread_do_exit
1153         which takes an extra parameter with the current frame pointer.
1154         Call new function with CURRENT_STACK_FRAME.
1155         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
1156         with the new parameter.
1157         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
1158         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
1159         this parameter as the initial value the cleanup handler records are
1160         compared against.  No active cleanup handler record must have an
1161         address lower than the previous one and the initial record must be
1162         above (below on PA) the frame address passed in.
1163         (pthread_setcancelstate): Call __pthread_do_exit instead of
1164         pthread_exit.
1165         (pthread_setcanceltype): Likewise.
1166         (pthread_testcancel): Likewise.
1167         (_pthread_cleanup_pop_restore): Likewise.
1168         * condvar.c (pthread_cond_wait): Likewise.
1169         (pthread_cond_timedwait_relative): Likewise.
1170         * manager.c (pthread_start_thread): Likewise.
1171         * oldsemaphore.c (__old_sem_wait): Likewise.
1172         * pthread.c (pthread_handle_sigcancel): Likewise.
1173         * semaphore.c (__new_sem_wait): Likewise.
1174         (sem_timedwait): Likewise.
1175         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
1176         to limit the cleanup handlers which get run.
1177         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
1178         for __pthread_perform_cleanup.
1180         * Makefile (tests): Add tst-cancel.
1181         * tst-cancel.c: New file.
1183 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
1185         * sysdeps/cris/pt-machine.h: New file.
1186         * sysdeps/cris/pspinlock.c: New file.
1188 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
1190         * shlib-versions: Add case for Linux on CRIS.
1192 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
1194         * attr.c (pthread_getattr_np): Correct computation of stack size
1195         for machiens with register stack.
1197         * Examples/ex17.c (main): Correct detection of failed mmap call.
1199 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1201         * pthread.c (__pthread_initialize_manager): Fix a typo.
1203 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1205         * attr.c (__pthread_attr_setstack): Fix alignment check.
1206         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
1207         * Makefile (tests): Add ex17 test.
1208         * Examples/ex17.c: New test.
1210 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
1212         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
1213         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
1214         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
1216 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
1218         * Makefile: When generating DSO link with libc_nonshared.a.
1220 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
1222         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
1224 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
1226         * internals.h (__pthread_init_max_stacksize): New prototype.
1227         * attr.c (__pthread_attr_setstacksize): Call
1228         __pthread_init_max_stacksize if not yet initialized.
1229         * pthread.c (__pthread_init_max_stacksize): New function.
1230         (__pthread_initialize_manager): Call it.
1231         Patch by <dtc@cmucl.cons.org>.
1233 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
1235         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
1237 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1239         * shlib-versions: Add rule for Linux on 64 bit S/390.
1240         * sysdeps/s390/s390-64/pt-machine.h: New file.
1241         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
1243 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1245         * sysdeps/s390/pt-machine.h: Move to...
1246         * sysdeps/s390/s390-32/pt-machine.h: ...here.
1247         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
1249 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
1251         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
1252         * attr.c: Implement pthread_getattr_np.
1253         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
1254         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
1255         * manager.c (pthread_handle_create): Initialize p_inheritsched.
1257 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1259         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
1260         code alignment.
1262 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
1264         * manager.c (manager_mask): Removed static vesion.  Now always local
1265         to __pthread_manager().
1266         (manager_mask_all): Removed completely.
1267         (__pthread_manager): Remove manager_mask_all initialization.
1268         (pthread_handle_create): Remove code to set and reset signal mask
1269         around __clone2() calls.
1271 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
1273         * spinlock.c (__pthread_lock): Force lock->__status to be read from
1274         memory on every spin.
1276 2001-02-10  Andreas Jaeger  <aj@suse.de>
1278         * Makefile (extra-objs): New.
1280 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
1282         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
1283         __pthread_initialize_minimal prototype.
1285 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1287         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
1289 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1291         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
1293 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
1295         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
1296         broken code.  Patch by Jes Sorensen.
1298 2001-02-06  Andreas Jaeger  <aj@suse.de>
1300         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
1301         to...
1302         * internals.h: ...here.
1304 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
1306         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1308 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
1310         * Versions: Remove __pthread_initialize_minimal.
1312 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
1314         * Makefile: Add rules to build crti.o and make it being used in
1315         building libpthread.so.
1316         * sysdeps/i386/Makefile: New file.
1317         * sysdeps/pthread/pt-initfini.c: New file.
1319         * pthread.c: Cleanups.
1321 2001-01-28  Andreas Jaeger  <aj@suse.de>
1323         * oldsemaphore.c (__old_sem_init): Adjust for last change.
1324         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1325         * spinlock.c: Likewise.
1327 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
1329         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
1330         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
1331         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
1332         * pthread.c: Likewise.
1333         * spinlock.h: Likewise.
1334         * sysdeps/pthread/pthread.h: Likewise.
1336 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
1338         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
1339         as struct __pthread_attr_s.
1341         * semaphore.h (sem_t): Cleanup namespace, rename status and
1342         spinlock elements.
1344 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
1346         * pthread.c (pthread_onexit_process): Clear
1347         __pthread_manager_thread_bos after freeing it.
1348         * Makefile (tests): Add ex16.
1349         * Examples/ex16.c: New file.
1351 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1353         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
1354         -z nodelete.
1355         * pthread.c (pthread_exit_process): Rename to...
1356         (pthread_onexit_process): ...this.
1357         (pthread_atexit_process, pthread_atexit_retcode): New.
1358         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
1359         and only if HAVE_Z_NODELETE is not defined.
1360         (__pthread_initialize_manager): Register pthread_atexit_retcode
1361         with __cxa_atexit.
1363 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
1365         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
1367 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1369         * Makefile (tests): Add ex15.
1370         * Examples/ex15.c: New test.
1372 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
1374         * pthread.c (pthread_exit_process): Free memory allocated for
1375         manager stack.
1377 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1379         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
1380         (pthread_free): Always unmap the stack.  It's safe now that we don't
1381         use MAP_FIXED to allocate stacks.
1383 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1385         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
1387         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
1389 2000-11-15  Wolfram Gloger  <wg@malloc.de>
1391         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
1392         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
1394 2000-12-27  Andreas Jaeger  <aj@suse.de>
1396         * Examples/ex13.c: Make local functions static.
1397         * ecmutex.c: Likewise.
1398         * joinrace.c: Likewise.
1399         * Examples/ex14.c: Likewise.
1401         * Examples/ex2.c: Make local functions static; reformat.
1402         * Examples/ex1.c: Likewise.
1403         * Examples/ex4.c: Likewise.
1404         * Examples/ex5.c: Likewise.
1405         * Examples/ex7.c: Likewise.
1407         * oldsemaphore.c: Add prototypes to shut up GCC.
1408         * pt-machine.c: Likewise.
1410         * weaks.c: Add prototype for pthread_exit.
1412         * internals.h: Add some prototypes, format prototypes and add
1413         missing externs.
1414         Move __libc_waitpid prototype to include/sys/wait.h.
1416         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
1417         * mutex.c: Likewise.
1418         * specific.c: Likewise.
1419         * ptfork.c: Likewise.
1421         * lockfile.c: Include internals.h to get prototypes.
1422         * events.c: Likewise.
1423         * sysdeps/alpha/pspinlock.c: Likewise.
1424         * sysdeps/arm/pspinlock.c: Likewise.
1425         * sysdeps/hppa/pspinlock.c: Likewise.
1426         * sysdeps/i386/pspinlock.c: Likewise.
1427         * sysdeps/ia64/pspinlock.c: Likewise.
1428         * sysdeps/m68k/pspinlock.c: Likewise.
1429         * sysdeps/mips/pspinlock.c: Likewise.
1430         * sysdeps/powerpc/pspinlock.c: Likewise.
1431         * sysdeps/s390/pspinlock.c: Likewise.
1432         * sysdeps/sh/pspinlock.c: Likewise.
1433         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
1434         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
1435         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
1437 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
1439         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
1440         (__pthread_attr_getstack): Return correct address.
1441         Add warnings for using pthread_attr_getstackaddr and
1442         pthread_attr_setstackaddr.
1444 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
1446         * Examples/ex6.c (test_thread): Make static.
1447         * Examples/ex12.c (test_thread): Make static and add noreturn
1448         attribute.
1450 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
1452         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
1453         and compare_and_swap_with_release_semantics returns int not long.
1455 2000-12-17  Andreas Jaeger  <aj@suse.de>
1457         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
1458         value.
1459         * sysdeps/arm/pt-machine.h (testandset): Likewise.
1460         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
1461         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
1462         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1463         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
1464         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
1466 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
1468         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
1469         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
1471 2000-12-17  Andreas Jaeger  <aj@suse.de>
1473         * internals.h: Add prototypes for testandset and
1474         __compare_and_swap to shut up gcc warnings.
1476 2000-12-06  Wolfram Gloger  <wg@malloc.de>
1478         * join.c (pthread_detach): Allow case where the thread has already
1479         terminated.
1481 2000-12-05  Andreas Jaeger  <aj@suse.de>
1483         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
1484         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1485         (__compare_and_swap): Likewise.
1486         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
1488 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
1490         * Examples/ex3.c (main): Cast int to long before casting to void *.
1491         (search): Cast void * to long, not int.
1492         * Examples/ex8.c (main, thread): Similarly.
1493         * Examples/ex11.c (main): Similarly.
1494         * Examples/ex14.c (worker, do_test): Similarly.
1495         * ecmutex.c (worker, do_test): Similarly.
1496         (nlocks): Cast to int.
1498 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
1500         * linuxthreads.texi:  Add documentation for pthreads attributes
1501         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
1502         patch.  Document pthread_[sg]etconcurrency().  Mark
1503         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
1505 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
1507         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1508         Don't define it.
1509         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1510         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
1512 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
1514         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
1515         not doing it right now.
1516         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
1518 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
1520         * Examples/ex4.c (main): Don't use exit() to avoid warning with
1521         broken compilers.
1523 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
1525         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
1526         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
1528         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
1529         discussing mutexes. (As per the Unix98 name for the API.)
1530         Changes documentation for pthread_mutexattr_setkind_np() and
1531         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
1532         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
1533         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
1534         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
1535         Begins to introduce discussion of the ``timed'' mutex type.  This
1536         discussion is currently incomplete.
1537         Patch by Bruce Mitchener <bruce@cubik.org>.
1539 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
1540             Yutaka Niibe  <gniibe@chroot.org>
1542         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
1543         has restrictions, use register.
1545 2000-10-23  Andreas Schwab  <schwab@suse.de>
1547         * Examples/ex14.c (TIMEOUT): Override default timeout.
1549 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
1551         * specific.c: Protect tsd array modification in thread data
1552         structures by getting the thread lock in pthread_key_delete and
1553         __pthread_destroy_specifics.
1554         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
1556 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1558         * sysdeps/pthread/bits/initspin.h: New file.
1559         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
1560         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
1561         (__pthread_alt_init_lock): Likewise.
1562         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
1564 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
1566         * oldsemaphore.c (__old_sem_init): Release lock with
1567         LT_SPINLOCK_INIT, not zero.
1568         * spinlock.c (__pthread_unlock): Likewise.
1569         (__pthread_alt_lock): Likewise.
1570         (__pthread_alt_timedlock): Likewise.
1571         (__pthread_alt_unlock): Likewise.
1572         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
1573         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
1574         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
1575         LT_SPINLOCK_INIT do initialize spinlocks not 0.
1577 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
1579         * shlib-versions: Add version definitions for hppa-linux.
1581 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1583         * sysdeps/hppa/pspinlock.c: New file.
1584         * sysdeps/hppa/pt-machine.h: New file.
1585         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
1587 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
1589         * mutex.c (__pthread_mutex_destroy): Correct test of
1590         busy mutex for mutexes using alternate fastlocks.
1591         Patch by dtc@cmucl.cons.org.
1593 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
1595         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
1597 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
1599         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
1600         test for owner first.
1601         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1603         * cancel.c (pthread_cancel): Don't do anything if cancelation is
1604         disabled.
1606 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
1608         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
1609         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1611         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
1612         _POSIX_MONOTONIC_CLOCK.
1614         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
1615         and explain why.
1617 2000-09-20  Andreas Jaeger  <aj@suse.de>
1619         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
1620         "testrtsig.h" conditional.
1622 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
1624         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
1625         pthread_attr_setstack.
1626         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
1627         pthread_attr_setstack.
1628         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
1630 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
1632         * Examples/ex14.c: New file.
1633         * Makefile (tests): Add ex14.
1635         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
1636         mutex.  Patch by dtc@cmucl.cons.org.
1638         * ecmutex.c: New file.
1639         * Makefile (tests): Add ecmutex.
1641 2000-09-04  H.J. Lu  <hjl@gnu.org>
1643         * attr.c (__pthread_attr_setguardsize): Use page_roundup
1644         instead of roundup to round up to the page size.
1646 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
1648         * manager.c (pthread_exited): Correctly report event as TD_REAP
1649         instead of TD_DEATH.  Fix comments.
1651 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
1653         * spinlock.h (testandset): Add cast to avoid warning.
1654         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1656 2000-09-02  Andreas Jaeger  <aj@suse.de>
1658         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
1659         prototype.
1661 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
1663         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1664         Fix typo in last patch (_mode -> _flags).
1666         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1667         Provide definition which respects _IO_USER_LOCK flag.
1669 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
1671         * manager.c (pthread_allocate_stack): Clear descriptor only if not
1672         mmaped.
1674 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
1676         * Makefile: Add rules to build and run unload.
1677         * unload.c: New file.
1679         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
1681         * sysdeps/pthread/pthread.h
1682         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
1683         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
1685 2000-08-24  Andreas Jaeger  <aj@suse.de>
1687         * Examples/ex13.c: Include <string.h> for strerror prototype and
1688         <stdlib.h> for abort prototype.
1689         (pthr_cond_signal_mutex): Rewrite to silence GCC.
1690         (thread_start): Remove unused variable err.
1691         (main): Silence GCC warnings.
1693 2000-08-22  Andreas Jaeger  <aj@suse.de>
1695         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
1697         * Makefile (tests): Add ex13.
1699 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
1701         * semaphore.h: Add restrict where required by AGd4.
1702         * sysdeps/pthread/pthread.h: Likewise.
1703         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
1705 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
1707         * Makefile (tests): Add ex12.  Add rule to build it.
1708         * Examples/ex12.c: New file.
1710 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
1712         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
1713         even though the implementation is not quite complete (but it reports
1714         it).  Define _POSIX_MESSAGE_PASSING to -1.
1715         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1717 2000-08-12  Andreas Jaeger  <aj@suse.de>
1719         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
1720         assembler.
1721         (__compare_and_swap): Likewise.
1722         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
1724 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
1726         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
1727         p_h_errnop correctly and not to NULL.
1729 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
1731         * Banner: Bump version number to 0.9.
1733 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
1735         * Makefile (tests): Add tststack.  Add rule to build the program.
1736         * tststack.c: New file.
1738         * internals.h: Declare __pthread_max_stacksize.
1739         * pthread.c (__pthread_max_stacksize): New variable.
1740         (__pthread_initialize_manager): Determine __pthread_initialize_manager
1741         value.
1742         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
1743         (pthread_allocate_stack): Allow kernel to choose stack address if
1744         FLOATING_STACKS.  This also handles variable-sized stacks.
1745         Always allocate stack and guardpage together.  Use mprotect to
1746         change guardpage access.
1747         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
1748         ARCH_STACK_MAX_SIZE.
1750         * attr.c (__pthread_attr_setstacksize): Also test value against
1751         upper limit.
1753         * manager.c (__pthread_nonstandard_stacks): Define only if
1754         THREAD_SELF is not defined.
1755         (pthread_allocate_stack): Always initialize gardaddr to a correct
1756         value.
1757         (pthread_handle_create): Unmap thread with one call.
1758         (pthread_free): Remove test for initial thread before removing stack.
1759         Unmap stack with one call.
1761         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
1762         1 to avoid removing the stack.
1764 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
1766         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
1767         load of spin lock to prime the cache before the atomic compare and
1768         exchange operation (cmpxchg4). This avoids the spinning on the
1769         cmpxchg4 instruction and reduces movement of the cache line back
1770         and forth between the processors (explanation by Asis K. Mallick
1771         from Intel). This basically makes the implementation operate the
1772         same as the Linux kernel implementation.
1774         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
1775         * sysdeps/ia64/pspinlock.c: New file.
1777 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
1779         * pthread.c: Move definition of __pthread_set_own_extricate_if...
1780         * spinlock.h: ...here.  Remove locking.
1781         * internals.h: Remove __pthread_set_own_extricate_if prototype.
1783         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
1784         (rwlock_rd_extricate_func): Don't determine self, let
1785         __pthread_lock do it.
1786         (rwlock_wr_extricate_func): Likewise.
1787         (rwlock_have_already): Optimize *pself handling a bit.
1789         * mutex.c: Use __builtin_expect.
1790         * pthread.c: Likewise.
1792 2000-08-02  Andreas Jaeger  <aj@suse.de>
1794         * sysdeps/s390/pspinlock.c: New file.
1795         * sysdeps/s390/pt-machine.h: New file.
1796         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
1798 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1800         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
1801         R3K.
1802         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1804 2000-07-26  Andreas Jaeger  <aj@suse.de>
1806         * pthread.c: Initialize p_sem_avail.
1808 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
1810         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
1811         * semaphore.c: Handle spurious wakeups.
1813         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
1814         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
1816         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
1817         (__pthread_wait_for_restart): Likewise.
1819         * condvar.c (pthread_cond_wait): Also check whether thread is
1820         cancelable before aborting loop.
1821         (pthread_cond_timedwait): Likewise.
1823         * signals.c (pthread_sighandler): Remove special code to restrore
1824         %gs on x86.
1825         (pthread_sighandler_t): Likewise.
1827 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
1829         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
1830         * pthread.c: Include <resolv.h>.
1831         (_res): Undefine.  Add extern declaration.
1833 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
1835         * pthread.c (__pthread_initial_thread): Update initializer.
1836         (__pthread_manager_thread): Likewise.
1837         (pthread_initialize): Move setrlimit call to...
1838         (__pthread_initialize_manager): ...here.
1839         (__pthread_reset_main_thread): Reset also soft limit on stack size.
1841         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
1842         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
1844 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
1846         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
1847         __compare_and_swap to define testandset.
1848         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
1849         Define IMPLEMENT_TAS_WITH_CAS.
1851 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
1853         * Makefile: Pass -z nodelete to linker for libpthread.so
1854         generation if it understand this option.
1856 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
1858         * manager.c (pthread_handle_create): Remove initialization of
1859         new_thread->p_res._sock.
1861 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
1863         Bugfixes to the variant of the code for machines with no compare
1864         and swap.
1866         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
1867         node was not being properly enqueued, due to failing to update
1868         the lock->__status field.
1870         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
1871         being set inappropriately, causing the suspend function to be called
1872         with a null self pointer and crash.
1874 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
1876         * spinlock.h (__pthread_alt_trylock): Fix code used if no
1877         compare&swap is available.
1879         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
1880         compare_and_swap.
1882         * pthread.c (pthread_initialize): Don't use sysconf to determine
1883         whether the machine has more than one processor.
1885         * spinlock.c (__pthread_alt_timedlock): Add back one of the
1886         removed thread_self calls.
1888 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1890         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
1891         __compare_and_swap to compare_and_swap in code which assumes
1892         compare swap is available.
1894 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1896         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
1897         bug whereby thr field of waitnode structure would not be correctly
1898         set unless a null self pointer is passed to the functions.
1899         Eliminated redundant calls to thread_self().
1901 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
1903         * pthread.c (__pthread_initialize_manager): Lock
1904         __pthread_manager_thread.p_lock before calling clone.
1906 2000-05-05  H.J. Lu  <hjl@gnu.org>
1908         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1909         have acquire semantics.
1910         (__compare_and_swap_with_release_semantics): New inline
1911         function.
1912         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1914 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
1916         * manager.c: Fix the problem with signals at startup.
1917         Change the way that thread stacks are allocated on IA64.
1918         Clean up some of the guard page allocation stuff.
1920 1999-12-19  H.J. Lu  <hjl@gnu.org>
1922         * internals.h (page_roundup): New.
1923         * attr.c (__pthread_attr_setguardsize); Use page_roundup
1924         instead of roundup.
1925         * manager.c (pthread_allocate_stack): Make sure guardaddr is
1926         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1927         is define.
1929 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
1931         * manager.c (pthread_allocate_stack): Unmap the stack top
1932         if failed to map the stack bottom.
1933         Fix the guard page.
1934         (pthread_free): Fix the guard page.
1936         * pthread.c (pthread_initialize): Set rlimit correctly for
1937         NEED_SEPARATE_REGISTER_STACK.
1939 1999-12-16  H.J. Lu  <hjl@gnu.org>
1941         * pthread.c (__pthread_initialize_manager): Pass
1942         __pthread_manager_thread_bos instead of
1943         __pthread_manager_thread_tos to __clone2.
1945 1999-12-16  H.J. Lu  <hjl@gnu.org>
1947         * manager.c (pthread_allocate_stack): Correct the calculation
1948         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1949         stack bottom.
1951 1999-12-13  H.J. Lu  <hjl@gnu.org>
1953         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
1954         bit after setting ar.ccv.
1956 1999-12-12  H.J. Lu  <hjl@gnu.org>
1958         * manager.c (pthread_allocate_stack): Make the starting
1959         address of the stack bottom page aligned. FIXME: it may
1960         need changes in other places.
1961         (pthread_handle_create): Likewise.
1963 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
1965         * manager.c (pthread_allocate_stack): Handle
1966         NEED_SEPARATE_REGISTER_STACK.
1967         (pthread_handle_create): Likewise.
1968         * pthread.c (__pthread_initialize_manager): Likewise.
1970         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
1972 1999-12-02  H.J. Lu  <hjl@gnu.org>
1974         * sysdeps/ia64/pt-machine.h: New.
1976 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
1978         * wrapsyscall.c: Mark non-__ protected names as weak.
1979         PR libc/1466.
1981 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
1983         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
1985 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
1987         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
1988         Add tests also to new alternative spinlock implementation.
1989         * spinlock.h: Likewise.
1990         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1992 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
1994         * Version: Export __sigaction.
1995         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
1996         of __sigaction.
1997         * pthread.c: Use __libc_sigaction instead of __sigaction.
1999         * condvar.c: Implement pthread_condattr_getpshared and
2000         pthread_condattr_setpshared.
2001         * mutex.c: Implement pthread_mutexattr_getpshared and
2002          pthread_mutexattr_setpshared.
2003         * Versions: Export new functions.
2004         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2006         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
2007         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
2008         is not selected.
2010 2000-07-04  Greg McGary  <greg@mcgary.org>
2012         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
2013         pragmas.  Include bp-sym.h only if _LIBC.
2015 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
2017         * spinlock.c (__pthread_unlock): Properly place write barrier.
2018         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2020 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
2022         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
2023         faster on SMP systems.  No more emulation of compare&swap for adaptive
2024         spinlocks.
2025         * spinlock.h: Likewise.
2026         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
2027         Replace fast with adaptive mutex.
2028         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
2029         * condvar.c: Likewise.
2030         * pthread.c: Define and initialize __pthread_smp_kernel variable.
2031         * internals.h: Declare __pthread_smp_kernel.
2032         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
2033         _pthread_fastlock structure.
2034         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2036         * pthread.c: Remove initialization to zero from global variables.
2038 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
2040         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
2042 2000-06-28  Greg McGary  <greg@mcgary.org>
2044         * weaks.c: Wrap BP_SYM () around weak extern declarations of
2045         pthread functions that have pointers in their return+arg signatures.
2047 2000-06-27  Greg McGary  <greg@mcgary.org>
2049         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
2050         extern declarations of pthread functions that have pointers in
2051         their return+arg signatures.
2053 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
2055         * Makefile (tests): Add ex11.  Add rules to build it.
2056         * Examples/ex11.c: New file.
2057         * rwlock.c: Fix complete braindamaged previous try to implement
2058         timedout functions.
2060         * spinlock.c: Pretty print.
2062 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
2064         * Makefile (tests): Add ex10.  Add rules to build it.
2065         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
2066         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
2067         * condvar.c (pthread_cond_wait): Allow mutex of kind
2068         PTHREAD_MUTEX_TIMED_NP.
2069         (pthread_cond_timedwait_relative): Likewise.
2070         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
2071         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
2072         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2073         (__pthread_mutex_lock): Use __pthread_alt_lock for
2074         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2075         (__pthread_mutex_timedlock): New function.
2076         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
2077         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2078         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
2079         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
2080         * spinlock.c: Implement alternate fastlocks.
2081         * spinlock.h: Add prototypes.
2082         * Examples/ex10.c: New file.
2083         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2084         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2086         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
2087         (__pthread_rwlock_timedrdlock): New function.
2088         (__pthread_rwlock_timedwrlock): New function.
2089         Use laternate fastlock function everywhere.
2091 2000-06-21  Andreas Jaeger  <aj@suse.de>
2093         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
2094         prototype.
2096         * join.c: Include <stdlib.h> for exit prototype.
2098 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
2100         * sysdeps/i386/useldt.h: Include <stdlib.h>.
2102         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
2103         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2105         * Makefile (libpthread-routines): Add barrier.
2106         (tests): Add ex9.  Add rule to build ex9.
2107         * Versions: Export barrier functions.
2108         * barrier.c: New file.
2109         * Examples/ex9.c: New file.
2110         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
2111         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
2112         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2114 2000-06-19  H.J. Lu  <hjl@gnu.org>
2116         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
2117         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
2118         (compare_and_swap_with_release_semantics): New. Default to
2119         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
2120         is not defined.
2122         * spinlock.c (__pthread_unlock): Call
2123         compare_and_swap_with_release_semantics () instead of
2124         compare_and_swap ().
2126 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
2128         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
2129         to errno directly.
2130         * sysdeps/pthread/timer_delete.c: Likewise.
2131         * sysdeps/pthread/timer_getoverr.c: Likewise.
2132         * sysdeps/pthread/timer_gettime.c: Likewise.
2133         * sysdeps/pthread/timer_settime.c: Likewise.
2135 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2137         Timer nodes are now reference counted, and can be marked
2138         as deleted. This allows for the safe release of the global mutex
2139         in the middle without losing the timer being operated on.
2141         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
2142         member is now an enum with three values, so that an intermediate
2143         state can be represented (deleted but not free for reuse yet).
2144         New refcount member added.
2145         * sysdeps/pthread/timer_routines.c: Likewise.
2147         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
2148         timer_valid): New inline functions added.
2150         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
2151         restructured, recursive deadlock bug fixed.
2153         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
2154         timer_addref to ensure that timer won't be deleted while mutex is not
2155         held. Also uses timer_invalid to perform validation of timer handle.
2156         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
2157         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
2159 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
2161         * shlib-versions: Add entry for SH.
2162         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
2164 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2166         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
2167         tightened up some critical regions and micro-optimized some list
2168         manipulation code.
2170         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2171         Returns int value now to indicate whether timer was queued at head.
2172         * sysdeps/pthread/posix-timer.h: Likewise.
2173         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
2174         new return value from __timer_thread_queue_timer to avoid waking
2175         up timer thread unnecessarily.
2177         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
2178         inuse flag, because this requires mutex to be held.  Callers updated
2179         to do the check when they have the mutex.
2180         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
2182         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
2183         regions: avoids making system calls while holding timer mutex, and
2184         a few computations were moved outside of the mutex as well.
2185         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
2187         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
2188         to list_unlink_ip, meaning idempotent.  Pointer manipulation
2189         changed to get better better code out of gcc.
2190         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
2191         version of list_unlink added here.
2192         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
2193         function in all places: idempotent one for timers, non-idempotent
2194         one for thread nodes.
2195         * sysdeps/pthread/timer_settime: Likewise.
2196         * sysdeps/pthread/timer_routines.c: Likewise.
2198 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
2200         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
2201         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2203         * sysdeps/pthread/Makefile: Remove tests definition.
2205 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
2206             Yutaka Niibe  <gniibe@chroot.org>
2208         * sysdeps/sh/pspinlock.c: New file.
2209         * sysdeps/sh/pt-machine.h: New file.
2211 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
2213         * Makefile (tests): Add joinrace.
2215         * Examples/ex6.c: Test return value of pthread_join.
2217 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
2219         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
2220         (__pthread_spin_trylock): Implement.
2221         (__pthread_spin_unlock): Implement.
2222         (__pthread_spin_init): Implement.
2223         (__pthread_spin_destroy): Implement.
2225 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2227         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
2228         really append the entry.
2230 2000-06-10  Andreas Jaeger  <aj@suse.de>
2232         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
2234 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
2236         * sysdeps/pthread/timer_create.c: Thread matching now done on
2237         clock type as well as thread attributes.
2238         There are individual global signal-delivering threads for
2239         different clock types.
2240         * sysdeps/pthread/posix-timer.h: Likewise.
2241         * sysdeps/pthread/timer_routines.c: Likewise.
2243         * sysdeps/pthread/timer_routines.c: Thread allocation and
2244         deallocation function now remembers to put thread on active
2245         list and remove from active list.
2246         Thus now the feature of binding multiple timers
2247         to a single thread actually works.
2249 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2251         * pthread.c (__pthread_create_2_1): Optimize a bit.
2253         * internals.h (invalid_handle): Also test for p_terminated != 0.
2254         (nonexisting_handle): New function.  Same as old invalid_handle.
2255         * join.c (pthread_join): Use nonexisting_handle instead of
2256         invalid_handle to test for acceptable thread handle.
2257         * manager.c (pthread_handle_free): Likewise.
2258         * joinrace.c: New file.
2259         Reported by Permaine Cheung <pcheung@cygnus.com>.
2261 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2263         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2264         Correct handling of matching variable.
2266         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
2267         avoid warnings.
2269         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2270         Be prepared for empty timer list.
2272         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
2273         CPUTIME clock ID.  Add support for thread clocks.
2275         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
2276         subtraction were switched.
2278         * sysdeps/pthread/timer_routines.c (init_module): Use
2279         THREAD_MAXNODES threads.
2281         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
2282         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
2283         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
2284         with sigqueueinfo is this system call is available.
2286         * sysdeps/pthread/timer_create.c (timer_create): Allow
2287         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
2289         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
2290         functionality.
2291         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
2293 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2295         * sysdeps/pthread/posix-timer.h: New file.
2296         * sysdeps/pthread/timer_create.c: New file.
2297         * sysdeps/pthread/timer_delete.c: New file.
2298         * sysdeps/pthread/timer_getoverr.c: New file.
2299         * sysdeps/pthread/timer_gettime.c: New file.
2300         * sysdeps/pthread/timer_routines.c: New file.
2301         * sysdeps/pthread/timer_settime.c: New file.
2302         * sysdeps/pthread/tst-timer.c: New file.
2304 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2306         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
2307         LINK_MAX definitions if necessary.
2309 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2311         Added missing fork time handling of global libio lock.
2313         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
2314         not just the individual stream locks. Rewritten to use new
2315         iterator interface provided by libio rather than accessing
2316         global variable.
2318         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
2319         which lock and unlock the stream list using the new interface
2320         provied by libio.
2321         * internals.h: Likewise.
2323         * ptfork.c (__fork): Now calls __flockfilelist before fork,
2324         and __funlockfilelist in the parent after the fork.
2325         Child still calls __fresetlockfiles as before.
2327         * linuxthreads.texi: Now explains what happens to streams at
2328         fork time. Also whole new section on forking and thread added.
2329         Definition of pthread_atfork moved out of Miscellaneous Functions
2330         to this new section.
2332 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
2334         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
2335         Add missing register.
2336         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
2338 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
2340         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
2341         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
2342         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
2344 2000-05-31  Andreas Jaeger  <aj@suse.de>
2346         * sysdeps/mips/pspinlock.c: Implement spinlocks.
2348 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
2350         * spinlock.c (__pthread_lock): Remove ASSERT.
2352         * Makefile (tests): Add ex8.
2353         * Examples/ex8.c: New file.
2355 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
2357         Bugfix: The pthread_atfork mechanism now takes care of its
2358         own internal mutex at fork time.
2360         * ptfork.c (__fork): Revised so that the mutex is held across
2361         the fork operation and while the handlers are called, and so that
2362         the child resets the mutex.
2364         * linuxthreads.texi: Updated pthread_atfork documentation to make
2365         it clear that fork and pthread_atfork can't be reentered from
2366         atfork handlers, that pthread_atfork and fork are mutually atomic,
2367         and that the handlers are inherited by the child process.
2369 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
2371         * Makefile (libpthread-routines): Add pspinlock.
2372         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
2373         Use struct _pthread_fastlock instead of pthread_spinlock_t.
2374         * condvar.c: Likewise.
2375         * internals.h: Likewise.
2376         * join.c: Likewise.
2377         * manager.c: Likewise.
2378         * mutex.c: Likewise.
2379         * pthread.c: Likewise.
2380         * rwlock.c: Likewise.
2381         * semaphore.c: Likewise.
2382         * signals.c: Likewise.
2383         * spinlock.h: Likewise.
2384         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
2385         * sysdeps/alpha/pspinlock.c: New file.
2386         * sysdeps/arm/pspinlock.c: New file.
2387         * sysdeps/i386/pspinlock.c: New file.
2388         * sysdeps/m68k/pspinlock.c: New file.
2389         * sysdeps/mips/pspinlock.c: New file.
2390         * sysdeps/powerpc/pspinlock.c: New file.
2391         * sysdeps/sparc/sparc32/pspinlock.c: New file.
2392         * sysdeps/sparc/sparc64/pspinlock.c: New file.
2393         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
2394         back to _pthread_fastlock.  Define new pthread_spinlock_t.
2396 2000-05-24  Andreas Jaeger  <aj@suse.de>
2398         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
2400 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
2402         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
2404 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
2406         * internals.h (__RES_PTHREAD_INTERNAL): Define.
2408 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2410         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
2411         object state is represented with additional bits which distinguish
2412         whether that state was set up in the current process, or
2413         in an ancestor process. If that state was set in an ancestor,
2414         it means that a fork happened while thread was executing the init
2415         function. In that case, the state is reset to NEVER.
2416         * mutex.c (__pthread_once_fork_prepare): New function.
2417         (__pthread_once_fork_child): Likewise
2418         (__pthread_once_fork_parent): Likewise
2419         (__pthread_reset_pthread_once): Removed.
2420         * ptfork.c (__fork): Call new handlers in mutex.c.
2421         * internals.h: Declarations of new mutex.c functions added.
2422         Declaration of removed function deleted.
2423         * linuxthreads.texi: Updated documentation about pthread_once
2424         to clarify what happens under cancellation and forking.
2426 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2428         * internals.h: New thread manager request type, REQ_KICK.
2429         * join.c (pthread_exit): main thread now calls exit() instead
2430         of _exit() in order to proper process cleanup.
2431         * manager.c (__pthread_manager): Do not terminate manager
2432         after unblocking main thread; wait for main thread's
2433         REQ_PROCESS_EXIT request instead.
2434         Also, added REQ_KICK case to handle new request; this just does
2435         nothing.
2436         * manager.c (pthread_exited): Do not terminate manager after
2437         unblocking main thread.
2438         * manager.c (__pthread_manager_sighandler): If the main thread
2439         is waiting for all other threads to die, send a REQ_KICK into
2440         the thread manager request pipe to get it to clean out the threads
2441         and unblock the main thread as soon as possible. This fixes
2442         the 2000 millisecond hang on shutdown bug.
2443         * Examples/ex7.c: New file, tests shutdown behavior when all threads
2444         including the main one call pthread_exit(), or implicitly do so.
2445         * Makefile (tests): Add ex7.
2447 2000-05-05  Andreas Jaeger  <aj@suse.de>
2449         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2450         (pthread_getcpuclockid): Correct test for ourselves.
2452 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
2454         * internals.h (struct _pthread_descr_struct): Reorganization.
2455         Allocate room for 16 pointers at head of the structure for future
2456         thread-local data handling.  Move p_self member in this area.
2457         * manager.c (pthread_handle_create): Adjust use of p_self.
2458         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
2459         * pthread.c (__pthread_initial_thread): Adjust initialization.
2460         (__pthread_manager_thread): Likewise.
2462 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
2464         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
2465         for eventmask larger than 1 word.
2467 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
2469         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
2470         * pthread.c (__pthread_initialize_minimal): New function.  Perform
2471         minimal initialization.
2472         (pthread_initialize): Remove this code here.
2473         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
2474         are working around the problem in glibc.
2476 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
2478         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
2479         now.  First gcc must be fixed (more concrete: libgcc).
2481 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
2483         * pthread.c: Remove special treatement for interrupt handlers on x86.
2484         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
2485         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
2486         necessary.
2487         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
2489 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
2491         * join.c (pthread_exit): Set p_terminated after reporting the
2492         termination event instead of before.
2494 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
2496         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
2497         if __USE_UNIX98.
2499 2000-04-18  Andreas Jaeger  <aj@suse.de>
2501         * Versions: Use ld instead of ld.so.
2503 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2505         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
2506         Remove the typedef keyword.
2508 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2510         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
2511         not stbar.
2512         (READ_MEMORY_BARRIER): Define.
2513         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
2514         MEMORY_BARRIER.
2515         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
2516         headers.
2518 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
2520         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2521         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
2522         use thread_handle().
2524 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
2526         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
2527         if fast mutex is used.  Don't initialize `already_canceled' twice.
2528         Correctly test for return value of timedsuspend.
2530         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
2531         therefore don't need the _rt versions of the signal handlers.
2533 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2535         * pthread.c (pthread_yield): New function.
2536         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
2537         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
2538         * internals.h: Declare __pthread_yield.
2540         * pthread.c (pthread_initialize): Avoid a bit more code if
2541         realtime signals are known to exist.
2543         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
2544         to dynamically detect RT signals and avoid generating compatibility
2545         functions with old kernel.
2546         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
2547         __pthread_restart_new directly.
2548         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
2549         __pthread_wait_for_restart_signal directly.
2550         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
2551         __pthread_timedsuspend_new directly.
2553 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2555         * condvar.c: Remove all the special code to handle cond_timedwait.
2556         Use timedsuspend instead.
2557         * internals.h: Declare __pthread_timedsuspend_old,
2558         __pthread_timedsuspend_new, and __pthread_timedsuspend.
2559         Remove declaration of __pthread_init_condvar.
2560         * pthread.c: Define __pthread_timedsuspend variable.
2561         (__pthread_timedsuspend_old): New function.  Timed suspension
2562         implementation for old Linux kernels.
2563         (__pthread_timedsuspend_new): New function.  Timed suspension
2564         implementation for new Linux kernels.
2565         * restart.h (timedsuspend): New function.  Call appropriate
2566         suspension function through __pthread_timedsuspend.
2567         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
2568         the code.
2569         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2571         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
2572         undefined.
2573         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
2574         where possible.
2575         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
2576         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2578         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
2579         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2581 2000-04-14  Andreas Jaeger  <aj@suse.de>
2583         * weaks.c: Fix typo.
2585         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
2586         2.2 for linuxthreads.
2588 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
2590         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2591         (pthread_getcpuclockid): Fix typo.
2593 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
2595         * Makefile (libpthread-routines): Add getcpuclockid.
2596         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
2597         * sysdeps/pthread/getcpuclockid.c: New file.
2598         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
2599         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
2601         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
2602         Defined.
2603         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2605         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
2606         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2607         and pthread_spin_unlock.
2608         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
2609         into pthread_spinlock_t.  Change all uses.
2610         * spinlock.c: Implement pthread_spin_lock.
2611         Rename __pthread_unlock to __pthread_spin_unlock and define weak
2612         alias for real name.
2613         Define pthread_spin_trylock, pthread_spin_init, and
2614         pthread_spin_destroy.
2615         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2616         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
2617         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2618         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
2619         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2620         and pthread_spin_unlock.
2621         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
2622         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2623         * condvar.c: Likewise.
2624         * internals.h: Likewise.
2625         * join.c: Likewise.
2626         * manager.c: Likewise.
2627         * mutex.c: Likewise.
2628         * pthread.c: Likewise.
2629         * rwlock.c: Likewise.
2630         * semaphore.c: Likewise.
2631         * signals.c: Likewise.
2633         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
2634         macros.
2635         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
2637 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2639         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
2640         _POSIX_SHARED_MEMORY_OBJECTS.
2642 2000-04-11  Andreas Jaeger  <aj@suse.de>
2644         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
2645         (__compare_and_swap): Mark as modifying memory.
2647 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
2649         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
2650         __volatile__.
2651         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
2652         Don't have the 'asm' __volatile__.
2654 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2656         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
2657         * spinlock.c (__pthread_lock): Add memory barriers.
2658         (__pthread_unlock): Likewise.
2659         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
2660         instruction.
2661         (RELEASE): Not needed anymore.
2662         (__compare_and_swap): Mark asm as modifying memory.
2663         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
2664         of MEMORY_BARRIER.
2665         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
2666         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
2667         (MEMORY_BARRIER): Define using stbar.
2668         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
2669         stbar.
2670         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
2671         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
2672         Mike Burrows <m3b@pa.dec.com>.
2674 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
2676         * signals.c (sigaction): Fix return value for the case SIG is one
2677         of the signals the implementation uses.
2678         Patch by Xavier.Leroy@inria.fr.
2680 2000-04-01  Andreas Jaeger  <aj@suse.de>
2682         * attr.c: Use shlib-compat macros.
2683         * oldsemaphore.c: Likewise.
2684         * pthread.c: Likewise.
2685         * weaks.c: Likewise.
2687 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
2689         * semaphore.c (sem_timedwait): New function.
2690         Patch by Carl Mailloux <carlm@oricom.ca>.
2691         * semaphore.h: Declare sem_timedwait.
2692         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
2694 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
2696         * sysdeps/pthread/Makefile: File removed.
2698 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
2700         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
2701         * internals.h (__pthread_reset_pthread_once): Add prototype.
2702         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
2704         * manager.c (pthread_handle_create): Store ID of new thread before
2705         clone call.
2707 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
2709         * attr.c: Use new macros from shlib-compat.h to define versions.
2710         * oldsemaphore.c: Likewise.
2711         * semaphore.c: Likewise.
2712         * weaks.c: Likewise.
2714         * pthread.c: Update for new SHLIB_COMPAT definition.
2716         * manager.c (__pthread_manager): Unmask debug signal.
2718         * pthread.c (pthread_initialize): Test for address of __dso_handle
2719         being NULL, not value.  Use __on_exit, not on_exit.
2720         Patch by Andreas Jaeger <aj@suse.de>.
2722         * pthread.c: Use new macros from shlib-compat.h to define versions.
2724 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
2726         * pthread.c (pthread_initialize): Instead of on_exit use
2727         __cxa_atexit if __dso_label is available to allow unloading the
2728         libpthread shared library.
2730 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
2732         * condvar.c: Make tests for ownership of mutex less strict.
2734 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
2736         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
2737         current thread and return error if not.
2738         (pthread_cond_timedwait_relative_old): Likewise.
2739         (pthread_cond_timedwait_relative_new): Likewise.
2741         * mutex.c (__pthread_once): Handle cancelled init function correctly.
2742         (pthread_once_cancelhandler): New function.
2743         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2745 2000-03-14  Andreas Jaeger  <aj@suse.de>
2747         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
2748         REG_GS.
2749         (pthread_handle_sigrestart_rt): Likewise.
2750         * signals.c (pthread_sighandler_rt): Likewise.
2752 2000-03-02  Andreas Jaeger  <aj@suse.de>
2754         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
2755         Reported by Sean Chen <sean.chen@turbolinux.com>.
2757 2000-02-28  Andreas Jaeger  <aj@suse.de>
2759         * rwlock.c: Fix typo.
2761 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
2763         * rwlock.c: Define __* variants of the functions and make old names
2764         aliases.
2765         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
2766         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
2768 2000-02-25  Andreas Jaeger  <aj@suse.de>
2770         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2771         pwrite64, lseek64, open64, and __open64 with version 2.2.
2773 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
2775         * semaphore.h (SEM_FAILED): Use 0 not NULL.
2777 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
2779         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
2780         nanosleep does not work either.  Get absolute time inside the
2781         loop.
2782         (pthread_cond_timedwait_relative_new): Likewise.
2783         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2785 2000-02-13  Andreas Jaeger  <aj@suse.de>
2787         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
2788         (pthread_cond_timedwait_relative_old): Likewise.
2790 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
2792         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
2793         but keep the code around.  A bug in the kernel prevent us from
2794         using the code.
2795         (pthread_cond_timedwait_relative_new): Likewise.
2796         (PR libc/1597 and libc/1598).
2798 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
2800         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
2801         loop around nanosleep calls instead of around most of the function
2802         (pthread_cond_timedwait_relative_new): Likewise.
2803         body.  Got rid of backwards goto and one local.
2805 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
2807         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
2808         before every nanosleep call to account for time spent in the rest
2809         of the function.
2810         (pthread_cond_timedwait_relative_new): Likewise.
2811         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
2813 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
2815         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
2816         from nanosleep call so that in case we restart we only wait for the
2817         remaining time.
2818         (pthread_cond_timedwait_relative_new): Likewise.
2819         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
2821 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
2823         * manager.c (pthread_allocate_stack): Compute guard page address
2824         correctly.  Patch by HJ Lu.
2826         * sysdeps/pthread/pthread.h: Define
2827         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
2829 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
2831         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
2832         preference handling.
2833         (pthread_rwlockattr_setkind_np): Allow
2834         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
2835         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2837 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
2839         * internals.h (pthread_readlock_info): New structure.
2840         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
2841         p_untracked_readlock_count.
2842         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2843         Add initializers for new fields.
2844         * manager.c (pthread_free): Free read/write lock lists.
2845         * queue.h (queue_is_empty): New function.
2846         * rwlock.c: Implement requirements about when readers should get
2847         locks assigned.
2848         * sysdeps/pthread/pthread.h
2849         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
2850         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
2851         Define this name as well.
2852         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2854 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
2856         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2857         Adjust initializers for struct _pthread_descr_struct change.
2858         * internals.h (struct _pthread_descr_struct): Move new elements to
2859         the end.
2861 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
2863         Redesigned how cancellation unblocks a thread from internal
2864         cancellation points (sem_wait, pthread_join,
2865         pthread_cond_{wait,timedwait}).
2866         Cancellation won't eat a signal in any of these functions
2867         (*required* by POSIX and Single Unix Spec!).
2868         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
2869         simultaneous condition variable signal (not required by POSIX
2870         or Single Unix Spec, but nice).
2871         * spinlock.c: __pthread_lock queues back any received restarts
2872         that don't belong to it instead of assuming ownership of lock
2873         upon any restart; fastlock can no longer be acquired by two threads
2874         simultaneously.
2875         * restart.h: Restarts queue even on kernels that don't have
2876         queued real time signals (2.0, early 2.1), thanks to atomic counter,
2877         avoiding a rare race condition in pthread_cond_timedwait.
2879 1999-12-31  Andreas Jaeger  <aj@suse.de>
2881         * internals.h: Remove duplicate prototype declarations.
2883         * weaks.c: Remove __THROW from prototypes since the file is not
2884         compiled by a C++ compiler.
2885         * internals.h: Likewise.
2887 1999-12-30  Andreas Jaeger  <aj@suse.de>
2889         * sysdeps/pthread/pthread.h: Move internal functions to...
2890         * sysdeps/pthread/bits/libc-lock.h: ...here.
2892 1999-12-29  Andreas Jaeger  <aj@suse.de>
2894         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
2896 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
2898         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
2899         beginning.
2901         * manager.c (__pthread_start): Add one more cast to prevent
2902         warning on 64bit machines.
2904 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
2906         * manager.c (pthread_handle_create): Set p_pid of new thread
2907         before calling the callback function to report a new thread.
2909 1999-12-20  Andreas Jaeger  <aj@suse.de>
2911         * pthread.c (pthread_initialize): Move getrlimit call after
2912         setting of errno.
2914 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
2916         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2917         pwrite64, lseek64, open64, and __open64.
2918         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2919         pwrite64, lseek64, open64, and __open64.
2921         * manager.c (pthread_allocate_stack): Correct computation of
2922         new_thread_bottom.  Correct handling of stack size and when the
2923         rlimit method to guard for stack growth is used.
2924         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2925         minus one pagesize (not two).
2927 1999-12-03  Andreas Jaeger  <aj@suse.de>
2929         * Versions: Add __res_state with version GLIBC_2.2.
2931         * errno.c (__res_state): New function to return thread specific
2932         resolver state.
2934         * pthread.c (pthread_initialize): Initialize p_resp.
2935         (__pthread_reset_main_thread): Also set p_resp.
2937         * manager.c (pthread_handle_create): Initialize p_resp.
2939         * internals.h: Add thread specific resolver state.
2940         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2942 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
2944         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2945         beginning.
2946         * sysdeps/i386/i686/pt-machine.h: Likewise.
2947         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2949 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
2951         * manager.c (pthread_start_thread_event): Initialize p_pid already
2952         here.
2954 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
2956         * internals.h: Add prototype for __pthread_manager_event.
2957         * manager.c (__pthread_manager_event): New function.
2958         (pthread_start_thread_event): Correct computation of self.
2959         Use INIT_THREAD_SELF.
2960         * pthread.c (__pthread_manager_thread): Initialize p_lock.
2961         (__pthread_initialize_manager): Respect event flags also for creation
2962         of the manager thread.
2964 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
2966         * pthread.c (__pthread_initialize_manager): Initialize
2967         __pthread_manager_thread.p_tid.
2969 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
2971         * internals.h: Declare __pthread_last_event.
2972         * manager.c: Define __pthread_last_event.
2973         (pthread_handle_create): Set __pthread_last_event.
2974         (pthread_exited): Likewise.
2975         * join.c (pthread_exit): Likewise.
2977         * Makefile (libpthread-routines): Add events.
2978         * events.c: New file.
2979         * internals.h: Protect against multiple inclusion.
2980         Include thread_dbP.h header.
2981         (struct _pthread_descr_struct): Add new fields p_report_events and
2982         p_eventbuf.
2983         Declare event reporting functions.
2984         * join.c (pthread_exit): Signal event if this is wanted.
2985         * manager.c (__pthread_threads_events): New variable.
2986         (pthread_handle_create): Take new parameters with event information.
2987         Signal TD_CREATE event if wanted.
2988         (__pthread_manager): Adjust pthread_handle_create call.
2989         (pthread_start_thread_event): New function.  Block until manager is
2990         finished and then call pthread_start_thread.
2991         (pthread_exited): Signal TD_REAP event if wanted.
2993 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
2995         * restart.h (suspend_with_cancellation): Rewrite as a macro.
2997         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
2999 1999-10-25  Andreas Jaeger  <aj@suse.de>
3001         * internals.h: Remove K&R compatibility.
3002         * no-tsd.c: Likewise.
3003         * semaphore.h: Likewise.
3004         * signals.c: Likewise.
3005         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
3006         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
3007         * weaks.c: Likewise.
3009 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
3011         * pthread.c: For i386, wrap pthread_handle_sigrestart and
3012         pthread_handle_sigcancel with functions that restore %gs from the
3013         signal context.  For each signal handling function, two wrappers
3014         are required, one for a non-RT signal and one for a RT signal.
3015         * signal.c: For i386, add code to restore %gs from the signal
3016         context in pthread_sighandler and pthread_sighandler_rt.
3018 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
3020         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
3022 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
3024         * pthread.c (__pthread_initial_thread): Pass argument to
3025         PTHREAD_START_ARGS_INITIALIZER.
3026         (__pthread_manager_thread): Likewise.
3028         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
3029         initialize function.
3031         * manager.c (pthread_handle_create): Remove p_startfct initialization.
3033         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
3035 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
3037         * internals.h: Correct return types for __libc_read and __libc_write.
3039 1999-10-09  Andreas Jaeger  <aj@suse.de>
3041         * internals.h: Add __new_sem_post to get prototype in
3042         manager.c; include semaphore.h for needed types.
3044 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
3046         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
3047         directly instead of calling sem_post which should not be necessary
3048         but is faster and might help in some case to work around problems.
3049         Patch by khendricks@ivey.uwo.ca [libc/1382].
3051 1999-10-08  Andreas Schwab  <schwab@suse.de>
3053         * sysdeps/pthread/Subdirs: New file.
3054         * Implies: Removed.
3056 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
3058         * Implies: New file.
3059         * internals.h (struct _pthread_descr_struct): Add p_startfct.
3060         * manager.c (pthread_handle_create): Initialize p_startfct.
3061         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
3063 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
3065         * manager.c (__linuxthreads_pthread_threads_max): New variable.
3066         * specific.c (__linuxthreads_pthread_keys_max): New variable.
3067         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
3069         * condvar.c (pthread_cond_timedwait_relative): Never return with
3070         EINTR.  Patch by Andreas Schwab.
3072 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
3074         * signals.c (sigaction): Correct last patch.  Don't select
3075         pthread_sighandler_rt based on the signal number but instead of
3076         the SA_SIGINFO flag.
3078 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
3080         * specific.c: Move definitions of struct pthread_key_struct and
3081         destr_function to ...
3082         * internals.h: ...here.
3084 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
3086         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
3087         this instead of pthread_handle_sigrestart if the signal is an RT
3088         signal.
3090         * signals.c: Handle passing through of sighandler arguments also
3091         for real-time signals.
3093 1999-09-03  Andreas Schwab  <schwab@suse.de>
3095         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
3096         fork as weak alias.
3097         (__vfork): New function, alias vfork.
3098         * Versions: Export __fork, vfork, and __vfork in libpthread.
3100 1999-08-23  Andreas Schwab  <schwab@suse.de>
3102         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
3103         call to signal handler.
3105 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
3107         * pthread.c (__pthread_reset_main_thread): Undo last change.
3108         (__pthread_kill_other_threads_np): Reset signal handlers for the
3109         signals we used in the thread implementation here.
3111 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
3113         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
3114         for the signals we used in the thread implementation [PR libc/1234].
3116         * Versions: Export __pthread_kill_other_threads_np from libpthread
3117         for GLIBC_2.1.2.
3119         * signals.c: Pass sigcontext through wrapper to the user function.
3121 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
3123         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
3124         __libc_internal_tsd_set.
3126 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3128         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
3129         needed anymore.
3131 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3133         * internals.h: Align _pthread_descr_struct to 32 bytes.
3134         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
3135         libc/1206.
3137 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3139         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
3140         swap function.
3142 1999-07-09  Cristian Gafton  <gafton@redhat.com>
3144         * Makefile (libpthread-routines): Add oldsemaphore routine.
3145         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
3146         sem_trywait, and sem_wait to GLIBC_2.1.
3147         * oldsemaphore.c: New file.
3148         * semaphore.c: Add default_symbol_versions for the changed functions.
3149         (__new_sem_init): Rename from sem_init.
3150         (__new_sem_post): Rename from sem_post.
3151         (__new_sem_wait): Rename from sem_wait.
3152         (__new_sem_trywait): Rename from sem_trywait.
3153         (__new_sem_getvalue): Rename from sem_getvalue.
3154         (__new_sem_destroy): Rename from sem_destroy.
3156 1999-06-23  Robey Pointer  <robey@netscape.com>
3158         * internals.h: Added p_nextlock entry to separate queueing for a
3159         lock from queueing for a CV (sometimes a thread queues on a lock
3160         to serialize removing itself from a CV queue).
3161         * pthread.c: Added p_nextlock to initializers.
3162         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
3164 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3166         * manager.c (pthread_handle_create): Free mmap region after stack
3167         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
3169 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3171         * man/pthread_cond_init.man: Correct example.
3172         Reported by Tomas Berndtsson <tomas@nocrew.org>.
3174         * linuxthreads.texi (Condition Variables): Likewise.
3176 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
3178         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
3179         casx not cas, also successful casx returns the old value in rd
3180         and not the new value.
3182 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
3184         * manager.c: If pthread_create() is given a NULL attribute
3185         and the thread manager runs with a realtime policy, set the
3186         scheduling policy of the newly created thread back to SCHED_OTHER.
3187         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
3188         initialize the schedpolicy field of new_thread->p_start_args
3189         to that of the calling thread.
3191 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
3193         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
3194         instruction does not allow memory element to use offset.
3196 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
3198         * manager.c (pthread_allocate_stack): Optimize initialization of new
3199         thread descriptor.
3201         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
3202         Don't use initializer since it is all zeroes.
3203         (__libc_once_define): Likewise.
3205 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3207         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
3208         doesn't exist anymore.
3209         * sysdeps/i386/Implies: Likewise.
3210         * sysdeps/m68k/Implies: Likewise.
3211         * sysdeps/mips/Implies: Likewise.
3212         * sysdeps/powerpc/Implies: Likewise.
3213         * sysdeps/sparc/sparc32/Implies: Likewise.
3214         * sysdeps/sparc/sparc64/Implies: Likewise.
3216 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
3218         * sysdeps/alpha/bits/semaphore.h: Removed.
3219         * sysdeps/powerpc/bits/semaphore.h: Removed.
3220         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
3221         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
3222         * Makefile (headers): Remove bits/semaphore.h.
3224         * semaphore.h: Define _pthread_descr if necessary.
3225         Don't include limits.h.  Define SEM_VALUE_MAX directly.
3226         Define SEM_FAILED.
3227         (sem_t): Protect element names with leading __.
3228         Add declarations for sem_close, sem_open, and sem_unlink.
3229         * semaphore.c: Adjust all functions for new element names.
3230         Define sem_close, sem_open, and sem_unlink.
3231         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
3232         GLIBC_2.1.1.
3233         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
3234         necessary.
3236 1999-03-16  H.J. Lu  <hjl@gnu.org>
3238         * specific.c (pthread_key_delete): Check th->p_terminated to see
3239         if the thread is running.
3241         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
3242         Added to GLIBC_2.0 for libc.so.
3244 1999-02-12  H.J. Lu  <hjl@gnu.org>
3246         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
3247         __libc_allocate_rtsig): Added to GLIBC_2.1.
3249         * internals.h (DEFAULT_SIG_RESTART): Removed.
3250         (DEFAULT_SIG_CANCEL): Removed.
3252         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
3253         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
3254         (__pthread_sig_restart, __pthread_sig_cancel,
3255         __pthread_sig_debug): Initialized.
3256         (pthread_initialize): Call init_rtsigs () to initialize
3257         real-time signals.
3259 1999-02-03  H.J. Lu  <hjl@gnu.org>
3261         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
3262         Don't restart the thread which sent REQ_DEBUG.
3263         (pthread_start_thread): Check if __pthread_sig_debug > 0
3264         before debugging.
3266         * pthread.c (__pthread_initialize_manager): Suspend ourself
3267         after sending __pthread_sig_debug to gdb instead of
3268         __pthread_sig_cancel.
3270 1999-01-24  H.J. Lu  <hjl@gnu.org>
3272         * manager.c (__pthread_manager): Delete __pthread_sig_debug
3273         from mask if __pthread_sig_debug > 0.
3274         (pthread_handle_create): Increment __pthread_handles_num.
3276         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
3277         * pthread.c (__pthread_initialize_manager): Likewise.
3279         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
3280         instead of __libc_allocate_rtsig (2).
3281         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
3282         instead of __pthread_sig_cancel.
3283         (pthread_handle_sigdebug): Fix comments.
3285 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
3287         * manager.c (pthread_allocate_stack): Set
3288         __pthread_nonstandard_stacks if user-specified stack is used.
3290 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
3292         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
3293         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
3295 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
3297         * pthread.c: Use a third signal __pthread_sig_debug distinct
3298         from __pthread_sig_cancel to notify gdb when a thread is
3299         created
3300         * manager.c: Likewise.
3301         * internals.h: Likewise.
3302         * signals.c: The implementation of sigwait(s) assumed that
3303         all signals in s have signal handlers already attached.
3304         This is not required by the standard, so make it work
3305         also if some of the signals have no handlers.
3307 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3309         * linuxthreads.texi: Remove pointers from first @node.  Move old
3310         @node spec inside comment.
3312 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
3314         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
3315         _IO_lock_unlock.
3317 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
3319         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
3320         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
3322 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
3324         * manager.c: Threads now send __pthread_sig_cancel on termination.
3325         Change clone call and signal masks.
3326         * thread.c (pthread_handle_sigrestart): Remove special code for
3327         manager.
3328         (pthread_handle_sigcancel): In manager thread call
3329         __pthread_manager_sighandler.
3330         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
3331         * sysdeps/i386/i686/pt-machine.h: Likewise.
3332         Patches by Xavier Leroy.
3334 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
3336         * spinlock.c (__pthread_unlock): Don't crash if called for an
3337         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
3339         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
3340         overall runtime.
3342 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
3344         * Examples/ex3.c: Wait until all threads are started before
3345         searching for the number to avoid race condition on very fast
3346         systems.
3348 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3350         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
3351         declaration since it's not needed.
3353         * sysdeps/pthread/pthread.h: Move internal functions to ...
3354         * internals.h: ...here.
3356 1998-12-02  H.J. Lu  <hjl@gnu.org>
3358         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
3359         SIGRTMIN is defined.
3360         (__pthread_sig_cancel): Likewise.
3362 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3364         * wrapsyscall.c: Include <sys/mman.h> for msync,
3365         <stdlib.h> for system and <termios.h> for tcdrain prototype.
3366         Correct msync declaration.
3368 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
3370         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
3371         __libc_tsd_set): New macros for new interface.
3372         * no-tsd.c: New file, provide uninitialized defns of
3373         __libc_internal_tsd_get and __libc_internal_tsd_set.
3374         * Makefile (routines): Add no-tsd.
3376 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
3378         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
3379         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3380         __libc_internal_tsd_set): Move decls to ...
3381         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
3382         declarations.
3384         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3385         __libc_internal_tsd_set): Make these pointers to functions, not
3386         functions; remove #pragma weak decls for them.
3387         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
3388         Define static functions and initialized pointers to them.
3390 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
3392         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
3393         (CFLAGS-specific.c): Likewise.
3394         (CFLAGS-pthread.c): Likewise.
3395         (CFLAGS-ptfork.c): Likewise.
3396         (CFLAGS-cancel.c): Likewise.
3397         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
3398         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
3400         * mutex.c (pthread_mutex_init): Define as strong symbol.
3401         (pthread_mutex_destroy): Likewise.
3402         (pthread_mutex_trylock): Likewise.
3403         (pthread_mutex_lock): Likewise.
3404         (pthread_mutex_unlock): Likewise.
3405         (pthread_mutexattr_init): Likewise.
3406         (pthread_mutexattr_destroy): Likewise.
3407         (pthread_once): Likewise.
3408         * ptfork.c (pthread_atfork): Likewise.
3409         * specific.c (pthread_key_create): Likewise.
3410         (pthread_setspecific): Likewise.
3411         (pthread_getspecific): Likewise.
3413 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3415         * linuxthreads.texi: Fix punctuation after xref.
3417 1998-11-10  H.J. Lu  <hjl@gnu.org>
3419         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
3420         if it is defined in <linux/limits.h>.
3422 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
3424         * spinlock.h (__pthread_trylock): Define inline.
3425         (__pthread_lock): Add extra parameter to declaration.  Declare
3426         using internal_function.
3427         (__pthread_unlock): Declare using internal_function.
3428         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
3429         of local variable self.  Avoid recomputing self.  Define using
3430         internal_function.
3431         (__pthread_trylock): Remove.
3432         (__pthread_unlock): Define using internal_function.
3433         * cancel.c: Adjust for __pthread_lock interface change.  Use already
3434         computed self value is possible.
3435         * condvar.c: Likewise.
3436         * join.c: Likewise.
3437         * manager.c: Likewise.
3438         * mutex.c: Likewise.
3439         * pthread.c: Likewise.
3440         * rwlock.c: Likewise.
3441         * semaphore.c: Likewise.
3442         * signals.c: Likewise.
3444 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
3446         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
3447         __ to field names of the struct.
3448         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
3449         Likewise.
3450         (pthread_attr_t): Likewise.
3451         (pthread_cond_t): Likewise.
3452         (pthread_condattr_t): Likewise.
3453         (pthread_mutex_t): Likewise.
3454         (pthread_mutexattr_t): Likewise.
3455         (pthread_rwlock_t): Likewise.
3456         (pthread_rwlockattr_t): Likewise.
3457         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
3458         * cancel.c: Likewise.
3459         * condvar.c: Likewise.
3460         * manager.c: Likewise.
3461         * mutex.c: Likewise.
3462         * pthread.c: Likewise.
3463         * ptlongjmp.c: Likewise.
3464         * rwlock.c: Likewise.
3465         * spinlock.c: Likewise.
3467 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
3469         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
3470         also with PT_EI.
3472         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
3473         definitions.
3475         * Makefile (libpthread-routines): Add pt-machine.
3476         * pt-machine.c: New file.
3477         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
3478         yet defined.  Use PT_EI in extern inline definitions.
3479         * sysdeps/arm/pt-machine.h: Likewise.
3480         * sysdeps/i386/pt-machine.h: Likewise.
3481         * sysdeps/i386/i686/pt-machine.h: Likewise.
3482         * sysdeps/m68k/pt-machine.h: Likewise.
3483         * sysdeps/mips/pt-machine.h: Likewise.
3484         * sysdeps/powerpc/pt-machine.h: Likewise.
3485         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
3486         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3488 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3490         * semaphore.h: Include <sys/types.h> so that _pthread_descr
3491         is declared.
3493 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
3495         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
3496         argument.
3497         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
3499 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3501         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
3502         guard.
3504 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3506         * signals.c (sigaction): Check that sig is less than NSIG to avoid
3507         array index overflow.
3509 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
3511         * sysdeps/pthread/semaphore.h: New file.
3513 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
3515         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
3516         _LIBC_TSD_KEY_DL_ERROR.
3518 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
3520         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
3521         * sysdeps/i386/pt-machine.h: Likewise.
3522         Suggested by Roland McGrath.
3524 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
3526         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
3527         access thread data with non-constant offsets.
3528         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
3529         necessary.
3531         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
3532         THREAD_SETMEM_NC definitions.
3534         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
3535         THREAD_SETMEM_NC.
3536         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3538 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
3540         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
3541         not already defined.
3542         (struct _pthread_descr_struct): Add p_self and p_nr field.
3543         * manager.c (__pthread_handles): Define second element to point
3544         to manager thread.
3545         (__pthread_handles_num): Initialize to 2.
3546         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
3547         (pthread_start_thread): Likewise.
3548         (pthread_handle_create): Start search for free slot at entry 2.
3549         Initialize new fields p_self and p_nr.
3550         Call __clone with CLONE_PTRACE if available.
3551         (pthread_free): Call FREE_THREAD_SELF if available.
3552         * pthread.c (__pthread_initial_thread): Initialize new fields.
3553         (__pthread_manager_thread): Likewise.
3554         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
3556         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
3557         elements of the thread descriptor.
3558         * condvar.c: Likewise.
3559         * errno.c: Likewise.
3560         * join.c: Likewise.
3561         * manager.c: Likewise.
3562         * pthread.c: Likewise.
3563         * ptlongjmp.c: Likewise.
3564         * semaphore.c: Likewise.
3565         * signals.c: Likewise.
3566         * specific.c: Likewise.
3567         * spinlock.c: Likewise.
3569         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
3571         * sysdeps/i386/useldt.h: New file.
3572         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
3574         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
3575         THREAD_SETMEM using __thread_self.
3576         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3578 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
3580         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
3581         turned out that we didn't need to queue after all.
3583 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
3585         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
3586         and wastes space; correct types.
3588 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
3590         * signals.c (sigaction): Handle NULL argument.
3592 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
3594         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
3595         of sigset_t.
3597 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3599         * Makefile (linuxthreads-version): Extract correct number from
3600         Banner.
3602 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
3604         * Banner: Bump version number to 0.8
3605         * FAQ.html: Many updates, in particular w.r.t. debugging.
3606         * manager.c: Support for non-default stacksize for
3607         LinuxThreads-allocated stacks;
3608         don't use guard pages for stacks with default size, rely on
3609         rlimit(RLIMIT_STACK) instead (it's cheaper).
3610         * attr.c: Likewise.
3611         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
3612         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
3613         * condvar.c: Likewise.
3614         * internals.h: Likewise.
3615         * restart.h: Likewise.
3616         * signals.c: Likewise.
3617         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
3619 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3621         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
3622         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
3623         * Versions: Put __pthread_mutexattr_settype under version
3624         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
3625         __pthread_mutexattr_gettype.
3627 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3629         * sysdeps/pthread/bits/libc-lock.h: Make
3630         __pthread_mutexattr_settype weak.  Don't make
3631         __pthread_mutexattr_setkind_np weak.
3633 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
3635         * manager.c (pthread_handle_create): Check whether sched_setscheduler
3636         call can succeed here.
3638         * mutex.c: Define __pthread_mutexattr_settype and make
3639         __pthread_mutexattr_setkind_np an alias.
3640         Likewise for __pthread_mutexattr_gettype.
3642 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3644         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
3645         is root.
3647 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
3649         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
3651 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3653         * Examples/ex6.c: Include <unistd.h> for usleep.
3655 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3657         * Examples/ex4.c (main): Use exit, not pthread_exit.
3659 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
3661         * Versions: Add __pthread_mutexattr_gettype and
3662         __pthread_mutexattr_settype.
3663         * lockfile.c: Use __pthread_mutexattr_settype instead of
3664         __pthread_mutexattr_setkind_np.
3665         * mutex.c: Define __pthread_mutexattr_gettype and
3666         __pthread_mutexattr_settype.
3667         * weak.c: Likewise.
3668         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
3669         __pthread_mutexattr_settype.
3670         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
3671         Use __pthread_mutexattr_settype.
3673 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
3675         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
3676         * mutex.c: Define weak alias pthread_mutexattr_gettype and
3677         pthread_mutexattr_settype.
3678         * sysdeps/pthread/pthread.h: Declare these functions.
3679         Move pthread_sigmask and pthread_kill declaration in separate header.
3680         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
3682 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
3684         * Makefile: Add rules to compile and run tests.
3685         * Examples/ex1.c: Little changes to fix warnings.
3686         * Examples/ex2.c: Likewise.
3687         * Examples/ex3.c: Likewise.
3688         * Examples/ex4.c: Likewise.
3689         * Examples/ex5.c: Likewise.
3690         * Examples/ex6.c: New file.
3692 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
3694         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
3696 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3698         * attr.c: Include <string.h>.
3700 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
3702         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
3703         * internals.h: Include limits.h.
3704         * manager.c: Use memcpy to copy sched_param.
3705         * ptfork.c: Include errno.h.
3706         * pthread.c: Likewise.
3707         * semaphore.c: Likewise.
3708         * specific.c: Likewise.
3709         * spinlock.h: Likewise.
3710         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
3711         type definition to ...
3712         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
3714 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
3716         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
3718         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
3719         as macros as demanded in POSIX.1, Annex C.
3721 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
3723         * internals.h (struct pthread_request): For free use pthread_t
3724         instead of pthread_descr.
3725         * join.c (pthread_join): Pass thread_id, not th to manager.
3726         (pthread_detach): Likewise.
3727         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
3728         (pthread_exited): Remove detached queue code.
3729         (pthread_handle_free): Expect thread ID parameter and use it to
3730         validate the thread decsriptor.  Don't use detached queue.
3731         Patches by Xavier Leroy.
3733 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3735         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
3736         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
3737         __pthread_atfork, __pthread_key_create, __pthread_once.
3738         * internals.h: Doc fix.
3739         * pthread.c (__pthread_initialize): Define again.
3741 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
3743         * manager.c (pthread_exited): If thread is not detached put it on
3744         special list.
3745         (pthread_handle_free): If thread is not on list with living threads
3746         search on list with detached threads.
3748         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
3749         for new definition of pthread_rwlock_t.
3751         * spinlock.c: Correct test whether to compile
3752         __pthread_compare_and_swap or not.
3754 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
3756         * attr.c: Finish user stack support.  Change locking code to be safe
3757         in situations with different priorities.
3758         * cancel.c: Likewise.
3759         * condvar.c: Likewise.
3760         * internals.h: Likewise.
3761         * join.c: Likewise.
3762         * manager.c: Likewise.
3763         * mutex.c: Likewise.
3764         * pthread.c: Likewise.
3765         * ptlongjmp.c: Likewise.
3766         * queue.h: Likewise.
3767         * rwlock.c: Likewise.
3768         * semaphore.c: Likewise.
3769         * semaphore.h: Likewise.
3770         * signals.c: Likewise.
3771         * spinlock.c: Likewise.
3772         * spinlock.h: Likewise.
3773         * sysdeps/pthread/pthread.h: Likewise.
3774         Patches by Xavier Leroy.
3776         * sysdeps/i386/i686/pt-machine.h: New file.
3778 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
3780         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
3781         [sg]et_stackaddr prototypes always available.
3783         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3784         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
3786 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
3788         * manager.c (pthread_free): Undo patch from 980430.
3789         Reported by David Wragg <dpw@doc.ic.ac.uk>.
3791 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
3793         * manager.c: Define __pthread_manager_adjust_prio and use it to
3794         increase priority when needed.
3795         * internals.h: Add prototype for __pthread_manager_adjust_prio.
3796         * mutex.c: Optimize mutexes to wake up only one thread.
3797         * pthread.c: Move PID of manager for global variable in structure
3798         element.
3799         Patches by Xavier Leroy.
3801 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
3803         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
3805 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3807         * attr.c: Correct typo.
3809 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
3811         * manager.c (pthread_free): Unmap guard before the stack.
3812         Patch by Matthias Urlichs.
3814 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
3816         * manager.c (pthread_free): Detect already free child.
3817         Patch by Xavier Leroy, reported by Matthias Urlichs.
3819 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3821         * Makefile (linuxthreads-version): Renamed back from
3822         libpthread-version.
3824 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
3826         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
3827         __libc_longjmp.
3829 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
3831         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
3832         * internals.h: Add definitions for new spinlock implementation.
3833         * ptlongjmp.c: New file.
3834         * spinlock.c: New file.
3835         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
3836         new function __pthread_acquire to prevent deadlocks with thread
3837         with different priorities.
3838         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
3840 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3842         * manager.c (__pthread_manager): Reduce first argument to select
3843         to include just the needed file descriptor.
3845 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
3847         * manager.c: Fix last patch which caused core dumps.
3849         * pthread.c: Correctly handle missing SIGRTMIN.
3851 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3853         * libpthread.map: Add __libc_internal_tsd_get and
3854         __libc_internal_tsd_set.  Add missing cancelable functions. Export
3855         libc internal versions of the cancelable functions.
3857 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
3859         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
3861 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
3863         * attr.c: Implement pthread_attr_[gs]etguardsize,
3864         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
3865         Change pthread_attr_init to have two interfaces.
3866         * internals.h (struct _pthread_descr_struct): Add new fields for
3867         above functions.
3868         * libpthread.map: Add names in GLIBC_2.1 section.
3869         * manager.c (pthread_handle_create): Implement guardsize and
3870         user stack.
3871         (pthread_free): Likewise.
3872         * pthread.c (pthread_create): Add new interface for changed
3873         pthread_attr_t.
3874         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
3875         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
3876         PTHREAD_STACK_MIN.
3878 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
3880         * manager.c: Enable resetting of the thread scheduling policy
3881         to SCHED_OTHER when the parent thread has a different one.
3883 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
3885         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3886         _POSIX_ASYNCHRONOUS_IO.
3888         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
3889         mutexes.
3890         * mutex.c: Implement new mutex types.
3892         * internals.h: Include <signal.h>.
3894         * libpthread.map: Add __erno_location and __h_errno_location.
3896         * errno.c: Return pointer to variable actually in use.  This might
3897         not be the one in the thread structure.
3898         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
3899         and p_h_errnop.
3900         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
3901         of manager thread structure.
3902         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
3903         thread.
3904         * pthread.c: Adapt initializer for thread structures.
3905         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
3906         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
3907         current thread to global variables.
3909 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
3911         * rwlock.c: New file.
3912         * Makefile (libpthread-routines): Add rwlock.
3913         * sysdeps/pthread/pthread.h: Define data structures and declare
3914         functions.
3915         * libpthread.map: Add new functions.
3917 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
3919         * sysdeps/arm/pt-machine.h: New file; add ARM support.
3920         * sysdeps/arm/Implies: likewise.
3921         * README: Document it.
3923 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3925         * signals.c: Remove unneeded initializer for sigwaited, saving a
3926         warning.
3928 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3930         * semaphore.c (sem_init): Set sem_spinlock only if available.
3932 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
3934         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3935         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3937         * Makefile: Update from LinuxThreads 0.7.
3938         * internals.h. Likewise.
3939         * manager.c: Likewise.
3940         * mutex.c: Likewise.
3941         * pthread.c: Likewise.
3942         * signals.c: Likewise.
3943         * specific.c: Likewise.
3944         * Examples/ex3.c: Likewise.
3946 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
3948         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3949         open.
3951 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
3953         * wrapsyscall.c: Add socket functions which are also cancelation
3954         points.
3956 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
3958         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
3959         New functions for fast thread specific data within libc.
3961         * internals.h: Add new array p_libc_specific to struct
3962         _pthread_descr_struct.
3964         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
3966 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
3968         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
3969         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
3971 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
3973         * internals.h (struct _pthread_descr_struct): Add definitions for
3974         two-level specific key handling.
3975         * manager.c (pthread_handle_create): Initialize specific memory array.
3976         * specific.c: Implement two-level key handling.
3977         * weaks.c: Don't provide dummy key handling.
3978         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
3979         Add definition of __libc_key_t.
3980         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
3981         as 1024.
3982         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
3983         PTHREAD_DESTRUCTOR_ITERATIONS.
3985         * manager.c (pthread_handle_create): Compare mmap result with
3986         MAP_FAILED.
3988         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
3989         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
3991 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
3993         sysdeps/sparc -> sysdeps/sparc/sparc32
3994         sysdeps/sparc64 -> sysdeps/sparc/sparc64
3996         * internals.h: Change definition of THREAD_SELF to be an expression,
3997         not a statement that did a return.
3998         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
3999         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
4000         Follow Solaris and use a "system reserved" register (%g6) to hold
4001         the thread descriptor.
4002         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
4004 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
4006         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
4007         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
4008         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
4010         * semaphore.c: Include spinlock.h only when needed.
4012         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
4013         keys for entries not in use.
4015         * weaks.c: Implement key handling functions for real.
4017 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
4019         Initial sparc64-linux support:
4020         * sysdeps/sparc64/Implies: New file.
4021         * sysdeps/sparc64/pt-machine.h: Likewise.
4023 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
4025         * semaphore.c: Include spinlock.h at correct place.
4026         Patch by HJ Lu.
4028 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
4030         The Great Bit File Move:
4031         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
4032         * sysdeps/powerpc/semaphorebits.h: Likewise.
4033         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
4034         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
4035         * sysdeps/pthread/libc-lock.h: -> bits/
4036         * sysdeps/pthread/stdio-lock.h: Likewise.
4037         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
4038         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
4039         * semaphore.h: Likewise.
4040         * sysdeps/pthread/pthread.h: Likewise.
4042         * lockfile.c: <foo.h> -> <bits/foo.h>.
4043         * semaphore.h: Likewise.
4045         * Makefile: (headers): foo.h -> bits/foo.h.
4046         * sysdeps/pthread/Makefile: Likewise.
4048 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
4050         * semaphore.c (sem_init): Set sem_spinlock only if available.
4052         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
4053         asm constraints.
4055 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
4057         Update from LinuxThreads 0.6.
4059         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
4060         and __sched_get_priority_min instead of names without `__'.
4062         * manager.c: Rewrite large parts to implement opaque pthread_t.
4064         * cancel.c: Adapt for opaque pthread_t type.
4065         * condvar.c: Likewise.
4066         * errno.c: Likewise.
4067         * join.c: Likewise.
4068         * mutex.c: Likewise.
4069         * pthread.c: Likewise.
4070         * signals.c: Likewise.
4071         * specific.c: Likewise.
4072         * restart.h: Likewise.
4073         * queue.h: Likewise.
4074         * Examples/ex3.c: Likewise.
4075         * Examples/ex4.c: Likewise.
4076         * sysdeps/pthread/pthread.h: Likewise.
4078         * pthread.c: Accumulate time for all threads in thread manager.
4080         * semaphore.c: Implement fallback implementation for architectures
4081         sometimes missing compare-exchange operations.
4083         * cancel.c (pthread_cancel): Validate handle argument.
4084         * join.c (pthread_join): Likewise.
4085         (pthread_detach): Likewise.
4086         * signals.c (pthread_kill): Likewise.
4088         * spinlock.h (acquire): Use __sched_yield not sched_yield.
4090         * queue.h (enqueue): Enqueue thread according to priority.
4092         * internals.c (struct pthread_start_args): New struct for passing
4093         args to cloning function.
4094         (struct _pthread): Rename to _pthread_descr_struct and adapt for
4095         opaque pthread_t.
4097         * Examples/Makefile (clean): Pass -f option to rm.
4099         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
4100         and define TEST_FOR_COMPARE_AND_SWAP.
4101         * sysdeps/i386/i486/pt-machine.h: Removed.
4103         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
4104         to 1024.
4106 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
4108         * restart.h (suspend): Clear p_signal before suspending.
4109         (suspend_with_cancellation): Likewise.
4110         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
4112         * weaks.c: Make __pthread_key_create return 1.
4113         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
4114         __libc_getspecific, __libc_setspecific, and __libc_key_t.
4115         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
4116         using libio.
4118 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
4120         * sysdeps/sparc/pt-machine (RELEASE): Fix.
4122 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
4124         * sysdeps/powerpc/Implies: Added.
4125         * sysdeps/powerpc/pt-machine.h: Added.
4126         * sysdeps/powerpc/semaphorebits.h: Added.
4128 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
4130         * pthread.c (__pthread_initial_thread): Correct
4131         initializer.
4132         (__pthread_manager_thread): Likewise.
4133         Reported by Andreas Jaeger.
4135 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
4137         Since sigset_t no longer fits in a register, we can't pass in the
4138         thread's initial mask so easily.  Take this opportunity to simplify
4139         the clone implementation by only accepting a single void* argument.
4141         * manager.c (__pthread_manager): Put thread vitals in the thread
4142         struct instead of as arguments through clone.
4143         (pthread_start_thread): Look for them there.
4144         * internals.h (struct _pthread): Add p_initial_fn,
4145         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
4146         * pthread.c (pthread_initialize_manager): Revise clone invocation.