fdcf98d2db513f2de147708c2a0f96a7932df952
[kopensolaris-gnu/glibc.git] / linuxthreads / ChangeLog
1 2003-01-15  Jakub Jelinek  <jakub@redhat.com>
2
3         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init,
4         __libc_lock_init_recursive): Initialize fields directly.
5
6 2003-01-15  Jakub Jelinek  <jakub@redhat.com>
7
8         * sysdeps/unix/sysv/linux/alpha/vfork.S (__vfork): Allow
9         __fork to be far away from __vfork ifndef SHARED.
10         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
11         Likewise.
12         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
13         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
14         Add a missing instruction.
15         * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Conditionally
16         branch to __fork even if __NR_vfork is not defined.
17
18 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
19
20         * tst-cancel-wrappers.sh: Allow .__*_asynccancel functions names
21         as well.
22
23 2003-01-14  Steven Munroe  <sjmunroe@us.ibm.com>
24
25         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
26
27 2003-01-14  Jakub Jelinek  <jakub@redhat.com>
28
29         * sysdeps/unix/sysv/linux/ia64/vfork.S (JUMPTARGET): Remove.
30
31 2003-01-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
32
33         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: Avoid
34         unterminated string literals.
35         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: Likewise.
36
37 2003-01-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
38
39         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
40         (PSEUDO): Code reordering.  Move CENABLE and CDISABLE literals from
41         PSEUDO_END to PSEUDO.
42         (PSEUDO_END): Remove.
43         (SINGLE_THREAD_P): Save an instruction.
44         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add missing
45         parameter to SINGLE_THREAD_P call.
46         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
47         Code reordering.
48
49 2003-01-10  Andreas Schwab  <schwab@suse.de>
50
51         * sysdeps/unix/sysv/linux/m68k/vfork.S: New file.
52
53 2003-01-10  Martin Schwidefsky  <schwidefsky@de.ibm.com>
54
55         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Setup
56         backchain in pseudo_cancel.  Minor code improvements.
57         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
58         Likewise.
59
60 2003-01-10  Martin Schwidefsky  <schwidefsky@de.ibm.com>
61
62         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
63         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
64
65 2002-01-12  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
66
67         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
68
69 2002-01-09  Richard Henderson  <rth@redhat.com>
70
71         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Assume only
72         ret follows pseudo, and thus avoid branch-to-branch in cancel
73         case.  Use SYSCALL_ERROR_LABEL.
74
75 2003-01-11  Philip Blundell  <philb@gnu.org>
76
77         * sysdeps/unix/sysv/linux/arm/vfork.S: New file.
78         * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (PSEUDO_RET):
79         Correctly unstack lr.
80         (UNDOARGS_5): Fix ordering of pushes and pops.
81         (SINGLE_THREAD_P_PIC): New.
82         (SINGLE_THREAD_P_INT): New.
83         (SINGLE_THREAD_P): Implement in terms of above.  Restore lr if it
84         was stacked.
85         (PSEUDO): Use SINGLE_THREAD_P_INT.
86
87 2003-01-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
88
89         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
90
91 2003-01-11  Jakub Jelinek  <jakub@redhat.com>
92
93         * sysdeps/ia64/tls.h (tcbhead_t): Change into dtv_t *, void *.
94         [HAVE_TLS_SUPPORT] (USE_TLS, TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN,
95         TLS_TCB_SIZE, TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, TLS_DTV_AT_TP,
96         INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV, TLS_INIT_TP, THREAD_SELF,
97         INIT_THREAD_SELF): Define.
98         [HAVE_TLS_SUPPORT]: Include descr.h.
99         (NONTLS_INIT_TP): Point __thread_self at the end of dummy
100         struct _pthread_descr_struct.
101         * sysdeps/ia64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
102         THREAD_SETMEM, THREAD_SETMEM_NC): Define using THREAD_SELF,
103         not __thread_self.
104         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Adjust
105         computation.
106         * pthread.c (__pthread_initialize_minimal): Use tcbp, not self
107         for TCB pointer.
108         (__pthread_initialize_manager): Rename tcb to mgr.
109         Use tcbp for TCB pointer, if TLS_DTV_AT_TP set mgr to sizeof (struct
110         _pthread_descr) below tcbp, otherwise to tcbp.
111         * manager.c (pthread_handle_create): If TLS_DTV_AT_TP, set
112         new_thread to be below _dl_allocate_tls ().  Adjust new_thread back
113         before freeing.  Fix clone arguments if report_events and USE_TLS.
114         (pthread_free): Adjust th back before freeing.
115
116 2003-01-10  Steven Munroe  <sjmunroe@us.ibm.com>
117
118         * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile: Moved to ...
119         * sysdeps/unix/sysv/linux/powerpc/Makefile: ...here.
120         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New File.
121
122 2003-01-09  Jakub Jelinek  <jakub@redhat.com>
123
124         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
125         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
126         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
127         [__ASSEMBLER__] (SINGLE_THREAD_P): Remove trailing ;;.
128         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
129         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
130         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
131         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
132         * tst-popen.c: New test.
133         * Makefile (tests): Add tst-popen.
134
135 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
136
137         * sysdeps/unix/sysv/linux/sigwait.c (do_sigwait): Add
138         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
139
140 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
141
142         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use
143         PSEUDO_PREPARE_ARGS.  Fix branch condition after SINGLE_THREAD_P.
144
145 2003-01-06  Philip Blundell  <philb@gnu.org>
146
147         * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: New file.
148
149 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
150
151         * internals.h (LIBC_CANCEL_HANDLED): Define.
152         * sysdeps/unix/sysv/linux/sigwait.c (LIBC_CANCEL_HANDLED): Add.
153         * signals.c (LIBC_CANCEL_HANDLED): Add.
154         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
155         * tst-cancel-wrappers.sh: Remove all exceptions.
156
157         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
158
159 2003-01-05  Andreas Schwab  <schwab@suse.de>
160
161         * sysdeps/m68k/Makefile: New file, use -fPIC for nonshared
162         objects.
163
164         * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (SINGLE_THREAD_P):
165         Fix for PIC.
166         (CENABLE): Likewise.
167         (CDISABLE): Likewise.
168
169 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
170
171         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
172         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
173
174         * Makefile (libc.so-no-z-defs): Define to yes.
175
176 2003-01-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
177
178         * sysdeps/sh/tls.h: Include dl-sysdep.h and stdint.h.
179         (tcbhead_t): Add multiple_threads member.
180         (TLS_INIT_TP_EXPENSIVE): Define.
181         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Don't use multi-line
182         strings.  Remove unused code.
183         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
184
185 2003-01-04  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
186
187         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
188         * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile: New file.
189
190 2003-01-04  Jakub Jelinek  <jakub@redhat.com>
191
192         * internals.h (LIBC_THREAD_GETMEM, LIBC_THREAD_SETMEM): Define
193         even if NOT_IN_libc is defined.
194
195 2003-01-05  Jakub Jelinek  <jakub@redhat.com>
196
197         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
198         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
199         * sysdeps/s390/Makefile: New file.
200         * sysdeps/s390/tcb-offsets.sym: New file.
201         * sysdeps/s390/tls.h: New file.
202
203 2003-01-03  Richard Henderson  <rth@redhat.com>
204
205         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
206
207 2003-01-03  Andreas Jaeger  <aj@suse.de>
208
209         * sysdeps/pthread/bits/libc-tsd.h: Declare weak_extern functions.
210
211 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
212
213         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
214
215 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
216
217         * tst-cancel-wrappers.sh: Exclude sigwait.c as well, it does not have
218         cancellation tests.
219
220 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
221
222         * internals.h (struct pthread_functions): Rename
223         ptr_pthread_cond_* fields to ptr___pthread_cond_*.
224         * pthread.c (pthread_functions): Adjust.
225         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
226         pthread_cond_*@GLIBC_2.0 compatibility symbols.
227         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
228         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
229         and pthread_cond_wait.
230
231         * sysdeps/pthread/bits/pthreadtypes.h (__pthread_cond_align_t): New
232         type.
233         (pthread_cond_t): Add __align member, shorten __padding.
234         * sysdeps/pthread/pthread.h (PHTREAD_COND_INITIALIZER): Initialize
235         __padding and __align too.
236
237         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call2): Add
238         __builtin_expect.
239         * sysdeps/pthread/sigaction.c: New file.
240         * sysdeps/unix/sysv/linux/raise.c: New file.
241         * sysdeps/unix/sysv/linux/sigwait.c: New file.
242         * sysdeps/unix/sysv/linux/fork.c (__pthread_fork): Protect
243         weak_extern with #ifndef SHARED.
244         * sysdeps/unix/sysv/linux/jmp-unwind.c (__pthread_cleanup_upto):
245         Likewise.
246         * signals.c (__sigaction): Renamed to...
247         (__pthread_sigaction): ... this.
248         (__sigaction): New strong alias, #ifdef SHARED only.
249         (sigaction): Protect with #ifdef SHARED.
250         (sigwait): Renamed to...
251         (__pthread_sigwait): ... this.
252         (sigwait): New strong alias, #ifdef SHARED only.
253         (raise): Renamed to...
254         (__pthread_raise): ... this.
255         (raise): New strong alias, #ifdef SHARED only.
256         * internals.h (__pthread_sigaction, __pthread_sigwait,
257         __pthread_raise): New prototypes.
258         (struct pthread_functions): Add ptr_pthread_sigaction,
259         ptr_pthread_sigwait, ptr_pthread_raise.
260         * pthread.c (pthread_functions): Renamed to...
261         (__pthread_functions): ... this.  No longer static, no longer
262         SHARED only.  Initialize ptr_pthread_sigaction, ptr_pthread_sigwait
263         and ptr_pthread_raise.
264         [SHARED] (ptr_pthread_functions): Change to &__pthread_functions.
265         * libc-cancellation.c (__pthread_thread_self): Remove weak_extern.
266         * ptfork.c (__fork, __vfork): Protect with #ifdef SHARED.
267         * ptlongjmp.c (siglongjmp, longjmp): Protect with #ifdef SHARED.
268
269         * Makefile (tests, tests-static): Add tst-cancel-static.
270         * tst-cancel-static.c: New test.
271
272 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
273
274         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
275
276 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
277
278         * sysdeps/pthread/bits/pthreadtypes.h (pthread_cond_t): Add padding.
279         * condvar.c: Add symbol versioning.  The compatibility versions
280         are the same as the change in the interface does not effect this
281         implementation.
282         * Versions [libpthread]: Add definitions for new pthread_cond_*
283         interfaces for version GLIBC_2.3.2.
284
285 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
286
287         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
288         __register_atfork.
289         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
290         for __register_atfork.
291
292 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
293
294         * sysdeps/i386/i686/pt-machine.h: Use __ASSEMBLER__ instead of
295         ASSEMBLER test macro.
296         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise.
297         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
298         * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise.
299         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
300         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
301         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
302
303         * sysdeps/pthread/errno-loc.c (__errno_location): Add
304         libc_hidden_def.
305         * sysdeps/pthread/herrno-loc.c (__h_errno_location): Likewise.
306         * sysdeps/pthread/res-state.c (__res_state): Likewise.
307         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
308         __libc_current_sigrtmax): Likewise.
309         * Versions [libc] (GLIBC_PRIVATE): Remove __libc_internal_tsd_get,
310         __libc_internal_tsd_set, __libc_internal_tsd_address,
311         __libc_alloca_cutoff.
312         [libpthread] (GLIBC_PRIVATE): Remove __libc_internal_tsd_get,
313         __libc_internal_tsd_set, __libc_internal_tsd_address.
314
315         * sysdeps/pthread/list.h: Remove assert.h include.
316         * sysdeps/unix/sysv/linux/fork.c: Include <fork.h>, not "fork.h".
317
318         * sysdeps/pthread/list.h: New file.
319         * sysdeps/unix/sysv/linux/jmp-unwind.c: New file.
320         * sysdeps/unix/sysv/linux/fork.c: New file.
321         * sysdeps/unix/sysv/linux/fork.h: New file.
322         * sysdeps/unix/sysv/linux/ia64/fork.h: New file.
323         * sysdeps/unix/sysv/linux/sparc/fork.h: New file.
324         * sysdeps/unix/sysv/linux/register-atfork.c: New file.
325         * sysdeps/unix/sysv/linux/unregister-atfork.c: New file.
326         * sysdeps/unix/sysv/linux/Makefile: New file.
327         * sysdeps/unix/sysv/linux/Versions: New file.
328         * ptlongjmp.c (pthread_cleanup_upto): Rename to...
329         (__pthread_cleanup_upto): ...this. Add targetframe argument,
330         use it instead of currentframe.  No longer static.
331         (siglongjmp, longjmp): Remove pthread_cleanup_upto calls.
332         * internals.h (__pthread_cleanup_upto, __pthread_fork): New prototypes.
333         (struct pthread_functions): Add ptr_pthread_fork,
334         ptr_pthread_cleanup_upto.
335         * pthread.c (pthread_functions): Initialize ptr_pthread_fork and
336         ptr_pthread_cleanup_upto.
337         * ptfork.c: Include fork.h.
338         (struct handler_list, struct handler_list_block): Remove.
339         (pthread_atfork_lock, pthread_atfork_prepare, pthread_atfork_parent,
340         pthread_atfork_child): Remove.
341         (pthread_insert_list, __pthread_atfork, pthread_call_handlers): Remove.
342         (__pthread_fork): New function.
343         (__fork, __vfork): Call __libc_fork.
344         * Makefile (libpthread-routines): Add old_pthread_atfork.
345         (libpthread-nonshared): Add pthread_atfork.
346         (others): Depend on $(objpfx)libpthread_nonshared.a.
347         ($(objpfx)libpthread_nonshared.a): New rule.
348         (install): Depend on $(inst_libdir)/libpthread.so.
349         ($(inst_libdir)/libpthread.so, $(inst_libdir)/libpthread_nonshared.a):
350         New rules.
351         (tests): Depend on libpthread_nonshared.a too.
352         * old_pthread_atfork.c: New file.
353         * pthread_atfork.c: New file.
354         * Makeconfig (shared-thread-library): Include libpthread_nonshared.a
355         too.
356
357 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
358
359         * forward.c: Make all functions available by default again.  It
360         caused too much trouble.
361         * internals.h (struct pthread_functions): Rename ptr_pthread_exit
362         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
363         ptr___pthread_attr_init_2_*.
364         * pthread.c (pthread_functions): Adjust.
365
366 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
367
368         * libc_pthread_init.c (__libc_pthread_init): Remove
369         MULTIPLE_THREADS_OFFSET check.
370         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
371         (SYSINFO_OFFSET): Remove.
372         * sysdeps/i386/Makefile [csu] (gen-as-const-headers): Add
373         tcb-offsets.sym.
374         * sysdeps/i386/tcb-offsets.sym: New file.
375         * sysdeps/pthread/tcb-offsets.h: New file.
376         * sysdeps/sparc/sparc32/tls.h: Removed.
377         * sysdeps/sparc/sparc64/tls.h: Move...
378         * sysdeps/sparc/tls.h: ...here.  Include tcb-offsets.h in assembler.
379         * sysdeps/sparc/Makefile: New file.
380         * sysdeps/sparc/tcb-offsets.sym: New file.
381         * sysdeps/ia64/tls.h: Include tcb-offsets.h in assembler.
382         * sysdeps/ia64/Makefile: New file.
383         * sysdeps/ia64/tcb-offsets.sym: New file.
384         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
385         (MULTIPLE_THREADS_OFFSET): Remove.
386         Replace defined MULTIPLE_THREADS_OFFSET
387         with defined FLOATING_STACKS && USE___THREAD.
388         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
389         (MULTIPLE_THREADS_OFFSET): Remove.
390         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
391         (MULTIPLE_THREADS_OFFSET): Remove.
392         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
393         (MULTIPLE_THREADS_OFFSET): Remove.
394         * pthread.c (__pthread_initialize_manager): Remove
395         MULTIPLE_THREADS_OFFSET cbeck.
396
397         * tst-cancel-wrappers.sh: Add line continuations.
398
399 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
400
401         * sysdeps/pthread/bits/libc-tsd.h: Include linuxthreads/descr.h
402         and bits/libc-lock.h.
403         (__libc_internal_tsd_get, __libc_internal_tsd_set,
404         __libc_internal_tsd_address): Remove.
405         (__pthread_internal_tsd_address, __pthread_internal_tsd_get,
406         __pthread_internal_tsd_set): New weak_externs.
407         (__libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Define
408         using __libc_maybe_call2.
409         (__libc_tsd_key_t): Move to ...
410         * descr.h (__libc_tsd_key_t): ...here.
411         Remove bits/libc-tsd.h include.
412         * sysdeps/pthread/errno-loc.c: New file.
413         * sysdeps/pthread/herrno-loc.c: New file.
414         * sysdeps/pthread/res-state.c: New file.
415         * libc-cancellation.c (THREAD_GETMEM, THREAD_SETMEM): Remove.
416         (__libc_enable_asynccancel, __libc_disable_asynccancel): Use
417         thread_self unconditionally.  Use LIBC_THREAD_[SG]ETMEM instead
418         of THREAD_[SG]ETMEM.
419         * specific.c (libc_internal_tsd_set): Renamed to...
420         __pthread_internal_tsd_set.  Remove static.
421         (libc_internal_tsd_get): Renamed to...
422         __pthread_internal_tsd_get.  Remove static.
423         (libc_internal_tsd_address): Renamed to...
424         __pthread_internal_tsd_address.  Remove static.
425         (__libc_internal_tsd_set, __libc_internal_tsd_get,
426         __libc_internal_tsd_address, __libc_alloca_cutoff): Remove.
427         * internals.h [!NOT_IN_libc] (LIBC_THREAD_GETMEM, LIBC_THREAD_SETMEM):
428         Define.
429         (__pthread_internal_tsd_set, __pthread_internal_tsd_get,
430         __pthread_internal_tsd_address): New prototypes.
431         (struct pthread_functions): Add
432         ptr_pthread_internal_tsd_([sg]et|address) fields.
433         [!NOT_IN_libc && !FLOATING_STACKS] (thread_self): Define.
434         * pthread.c (pthread_functions) [!USE_TLS && !HAVE___THREAD]:
435         Initialize ptr_pthread_internal_tsd_([sg]et|address) fields.
436         * Versions (libpthread): Remove __libc_alloca_cutoff@GLIBC_PRIVATE.
437         * alloca_cutoff.c: New file.
438         * no-tsd.c: Removed.
439         * Makefile (routines): Remove no-tsd.  Add alloca_cutoff.
440         * pt-system.c (system): Remove cancellation handling.
441         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
442         cancellation routines.
443
444         * sysdeps/i386/tls.h: Include dl-sysdep.h and stdint.h.
445         (tcbhead_t): Add sysinfo field.
446         (SYSINFO_OFFSET, INIT_SYSINFO): Define.
447         (TLS_INIT_TP): Use INIT_SYSINFO.
448         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
449         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
450         (MULTIPLE_THREADS_OFFSET): Adjust.
451         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
452         (MULTIPLE_THREADS_OFFSET): Likewise.
453         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
454         (MULTIPLE_THREADS_OFFSET): Likewise.
455         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
456         (MULTIPLE_THREADS_OFFSET): Likewise.
457         * descr.h: Include stdint.h.
458         (struct _pthread_descr_struct): Add p_header.data.sysinfo field.
459
460 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
461
462         * libc_pthread_init.c: Include stdlib.h.
463         * sysdeps/i386/tls.h (tcbhead_t): Add multiple_threads member.
464         (TLS_INIT_TP_EXPENSIVE): Define.
465         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call,
466         __libc_maybe_call2): In _LIBC check SHARED define.
467         * sysdeps/ia64/tls.h: New file.
468         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
469         * sysdeps/unix/sysv/linux/ia64/Makefile: New file.
470         * sysdeps/x86_64/tls.h (TLS_INIT_TP_EXPENSIVE): Define.
471         * sysdeps/sparc/sparc32/tls.h: New file.
472         * sysdeps/sparc/sparc64/tls.h: New file.
473         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
474         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
475         * Makefile (tests): Add tst-cancel[1-6].
476         (tests-reverse): Add tst-cancel5.
477         Link libc.so before libpthread.so for tests-reverse.
478         * tst-cancel1.c: New file.
479         * tst-cancel2.c: New file.
480         * tst-cancel3.c: New file.
481         * tst-cancel4.c: New file.
482         * tst-cancel5.c: New file.
483         * tst-cancel6.c: New file.
484
485 2002-12-27  Andreas Schwab  <schwab@suse.de>
486
487         * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: New file.
488
489 2002-12-22  Roland McGrath  <roland@redhat.com>
490
491         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
492
493 2002-12-21  Ulrich Drepper  <drepper@redhat.com>
494
495         * pthread.c (init_rtsigs): Remove incomplete __builtin_expect.
496         Reported by Art Hass <ahaas@airmail.net>.
497
498 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
499
500         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
501         Use return 0 as 6th argument to FORWARD4.
502
503 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
504
505         * sysdeps/i386/useldt.h (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Only
506         define if __ASSUME_LDT_WORKS > 0.
507         * libc-cancellation.c (THREAD_GETMEM, THREAD_SETMEM): Redefine to
508         struct member access if !FLOATING_STACKS.
509         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
510
511 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
512
513         * internals.h (__pthread_thread_self): New prototype.
514         (struct pthread_functions): Add ptr_pthread_thread_self field.
515         * pthread.c (pthread_functions): Initialize ptr_pthread_thread_self.
516         (__pthread_thread_self): New function.
517         * libc-cancellation.c (__pthread_thread_self): Add weak_extern.
518         (__libc_enable_asynccancel, __libc_disable_asynccancel): Don't
519         use thread_self() directly if not FLOATING_STACKS.
520
521 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
522
523         * sysdeps/x86_64/pt-machine.h: Guard most of the header
524         with #ifndef __ASSEMBLER__.
525         * pthread.c (pthread_functions): Use SHLIB_COMPAT around
526         pthread_attr_init_2_0 use.
527
528 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
529
530         * wrapsyscall.c: Removed.
531         * weaks.c: Removed.
532         * Makefile (distribute): Add tst-cancel-wrappers.sh.
533         (routines): Remove weaks.  Add forward,
534         libc_pthread_init, libc-cancellation.
535         (shared-only-routines): Remove weaks.  Add forward.
536         (libpthread-routines): Remove wrapsyscall.
537         Add ptw-write, ptw-read, ptw-close, ptw-fcntl, ptw-accept,
538         ptw-connect, ptw-recv, ptw-recvfrom, ptw-recvmsg, ptw-send,
539         ptw-sendmsg, ptw-sendto, ptw-fsync, ptw-lseek, ptw-lseek64,
540         ptw-llseek, ptw-msync, ptw-nanosleep, ptw-open, ptw-open64,
541         ptw-pause, ptw-pread, ptw-pread64, ptw-pwrite, ptw-pwrite64,
542         ptw-tcdrain, ptw-wait, ptw-waitpid, pt-system, pt-allocrtsig.
543         (libpthread-shared-only-routines): Add pt-allocrtsig.
544         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
545         ($(objpfx)tst-cancel-wrappers.out): New rule.
546         * sysdeps/pthread/bits/libc-lock.h: Include linuxthreads/internals.h
547         if in libc.
548         (__libc_maybe_call): In libpthread.* don't check for existance
549         of the function.
550         (__libc_maybe_call2): Define.
551         (__libc_lock_init, __libc_lock_fini, __libc_lock_lock,
552         __libc_lock_trylock, __libc_lock_unlock): Use it.
553         * sysdeps/pthread/flockfile.c: New file.
554         * sysdeps/pthread/ftrylockfile.c: New file.
555         * sysdeps/pthread/funlockfile.c: New file.
556         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
557         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
558         * sysdeps/unix/sysv/linux/allocrtsig.c: New file.
559         * libc-cancellation.c: New file.
560         * forward.c: New file.
561         * libc_pthread_init.c: New file.
562         * pt-system.c: New file.
563         * pthread.c: Remove locale.h.
564         (__pthread_manager_thread): Initialize multiple_threads.
565         (__pthread_multiple_threads): Declare.
566         (pthread_functions): New variable.
567         (__pthread_initialize_minimal): Remove __uselocale call.
568         Call __libc_pthread_init.
569         (__pthread_initialize_manager): Initialize __pthread_multiple_threads,
570         initial thread's multiple_threads and __libc_multiple_threads.
571         Check MULTIPLE_THREADS_OFFSET value. Initialize manager thread's
572         multiple_threads.
573         (pthread_setschedparam, pthread_getschedparam): Rename to __
574         prefixed variants.  Add strong_alias.
575         (current_rtmin, current_rtmax, __libc_current_sigrtmin,
576         __libc_current_sigrtmax, __libc_allocate_rtsig): Remove.
577         (init_rtsigs): Use __libc_current_sigrtmin_private.
578         (pthread_initialize): Only call init_rtsigs if
579         !__ASSUME_REALTIME_SIGNALS.
580         (__pthread_require_wrappers, __pthread_require_lockfile): Remove.
581         * internals.h (__pthread_attr_destroy, __pthread_attr_setdetachstate,
582         __pthread_attr_getdetachstate, __pthread_attr_setschedparam,
583         __pthread_attr_getschedparam, __pthread_attr_setschedpolicy,
584         __pthread_attr_getschedpolicy, __pthread_attr_setinheritsched,
585         __pthread_attr_getinheritsched, __pthread_attr_setscope,
586         __pthread_attr_getscope, __pthread_cond_init,
587         __pthread_cond_destroy, __pthread_cond_wait,
588         __pthread_cond_signal, __pthread_cond_broadcast,
589         __pthread_condattr_init, __pthread_condattr_destroy,
590         __pthread_equal, __pthread_getschedparam,
591         __pthread_setschedparam, __pthread_setcancelstate,
592         __pthread_setcanceltype, __pthread_enable_asynccancel,
593         __libc_enable_asynccancel, __libc_pthread_init): New prototype.
594         (__pthread_mutex_init, __pthread_mutex_destroy,
595         __pthread_mutex_lock, __pthread_mutex_unlock,
596         __pthread_mutex_trylock): Likewise.
597         Add hidden_proto.
598         (struct pthread_functions): New type.
599         (__libc_pthread_functions): New variable.
600         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define.
601         * descr.h (struct _pthread_descr_struct): Add
602         p_header.data.multiple_threads field.
603         * manager.c (pthread_handle_create): Initialize multiple_threads.
604         * cancel.c (__pthread_enable_asynccancel,
605         __pthread_disable_asynccancel): New functions.
606         (__pthread_provide_wrappers): Remove.
607         (pthread_setcancelstate, pthread_setcanceltype): Rename to __
608         prefixed variants.  Add strong_alias.
609         * condvar.c (pthread_cond_init, pthread_cond_destroy,
610         pthread_cond_wait, pthread_cond_signal, pthread_cond_broadcast,
611         pthread_condattr_init, pthread_condattr_destroy): Likewise.
612         * join.c (pthread_exit): Likewise.
613         * attr.c (pthread_attr_destroy, pthread_attr_setdetachstate,
614         pthread_attr_getdetachstate, pthread_attr_setschedparam,
615         pthread_attr_getschedparam, pthread_attr_setschedpolicy,
616         pthread_attr_getschedpolicy, pthread_attr_setinheritsched,
617         pthread_attr_getinheritsched, pthread_attr_setscope,
618         pthread_attr_getscope): Likewise.
619         * mutex.c (__pthread_mutex_init, __pthread_mutex_destroy,
620         __pthread_mutex_lock, __pthread_mutex_unlock,
621         __pthread_mutex_trylock): Add hidden_def.
622         * Versions (libc): Add __libc_pthread_init,
623         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
624         __libc_allocate_rtsig_private @@GLIBC_PRIVATE.
625         * lockfile.c: Remove some USE_IN_LIBIO guards.
626         (__pthread_provide_lockfile): Remove.
627         * pt-allocrtsig.c: New file.
628         * tst-cancel-wrappers.sh: New test.
629
630 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
631
632         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
633         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
634         * wrapsyscall.c: Remove creat, poll, pselect, readv, select,
635         sigpause, sigsuspend, sigwaitinfo, waitid, and writev wrappers.
636
637 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
638
639         * wrapsyscall.c (CANCELABLE_SYSCALL): Don't define function as
640         weak.  There is no reason for that.
641         (CANCELABLE_SYSCALL_VA): Likewise.
642
643 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
644
645         * wrapsyscall.c: Add wrappers for creat, poll, pselect, readv, select,
646         sigpause, __xpg_sigpause, sigsuspend, sigwaitinfo, waitid, and writev.
647         * Versions: Export creat, poll, pselect, readv, select, sigpause,
648         __xpg_sigpause, sigsuspend, sigwaitinfo, waitid, and writev from
649         libpthread in version GLIBC_2.3.2.
650
651 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
652
653         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
654
655 2002-12-05  Roland McGrath  <roland@redhat.com>
656
657         * pthread.c (__pthread_initialize_minimal)
658         [USE_TLS && SHARED && !USE___THREAD]: Initialize TLS and set up the
659         TCB if the dynamic linker didn't do it at startup.
660
661         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
662         string.
663         (TLS_DO_SET_THREAD_AREA, TLS_DO_MODIFY_LDT, TLS_SETUP_GS_SEGMENT):
664         Submacros updated.
665         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
666         * sysdeps/alpha/tls.h (TLS_INIT_TP): Likewise (always zero).
667
668 2002-12-03  Roland McGrath  <roland@redhat.com>
669
670         * pthread.c (pthread_initialize) [SHARED]: Copy dl_error_tsd value
671         from dynamic linker internal cell to new libc cell.
672
673 2002-11-28  Roland McGrath  <roland@redhat.com>
674
675         * tst-context.c: #define IS_IN_libpthread around #include <tls.h>
676         before other headers, so FLOATING_STACKS is not defined wrongly.
677
678         * sysdeps/i386/tls.h [!IS_IN_libpthread]: Enable TLS support
679         even if [! FLOATING_STACKS].
680         (TLS_DO_MODIFY_LDT_KERNEL_CHECK): New macro.
681         If not under [__ASSUME_LDT_WORKS > 0], then do a runtime check of
682         dl_osversion >= 2.3.99 and fatal if not.
683         (TLS_DO_MODIFY_LDT): Use it.
684
685 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
686
687         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
688         require it to 200112L.  Remove _POSIX_POLL and _POSIX_SELECT.
689         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
690
691 2002-11-19  Ulrich Drepper  <drepper@redhat.com>
692
693         * Versions (libc: GLIBC_2.0): Remove names of functions which are
694         not defined in libc.
695         * Makefile (shared-only-routines): Add weaks.
696         * weaks.c: Remove functions which are not exported from libc.so.
697
698 2002-11-14  Roland McGrath  <roland@redhat.com>
699
700         * libc-tsd.c: New file.
701         * Makefile (distribute): Add it.
702         (libc-link.so): New variable.
703         ($(objpfx)libpthread.so): Depend on that instead of libc.so file name.
704         (libc-ok-for-link): New variable.
705         [$(versioning) = yes]: Include $(common-objpfx)tls.make and define
706         libc-ok-for-link to $(use-thread).
707         [$(libc-ok-for-link) = no]
708         (libc-link.so): Set to $(objpfx)libc.so, not $(common-objpfx)libc.so.
709         ($(objpfx)libc_pic_lite.a,$(objpfx)libc_pic_lite.os, $(objpfx)libc.so):
710         New targets.
711         (generated): Append them.
712         (extra-objs): Append libc-tsd.os.
713
714         * libc-tls-loc.c: New file.
715         * Makefile (libpthread-routines): Add it.
716
717 2002-11-14  Andreas Schwab  <schwab@suse.de>
718
719         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Fix unterminated
720         string.
721
722 2002-11-13  Roland McGrath  <roland@redhat.com>
723
724         * Examples/ex6.c (main): Improve error reporting.
725
726 2002-11-04  Ulrich Drepper  <drepper@redhat.com>
727
728         * sysdeps/i386/Makefile: Compile pthread.c and sighandler.c with
729         -fno-omit-frame-pointer.  Patch by Andreas Steinmetz <ast@domdv.de>.
730
731         * sysdeps/i386/useldt.h [PIC] (USETLS_LOAD_EBX): Use correct input
732         register number.
733         (DO_SET_THREAD_AREA): Mark asm output specifiers correctly.
734
735 2002-10-22  Jakub Jelinek  <jakub@redhat.com>
736
737         * manager.c (pthread_start_thread): Call __uselocale even
738         if [! SHARED].  Patch by Leon Kanter <leon@geon.donetsk.ua>.
739
740 2002-10-17  Roland McGrath  <roland@redhat.com>
741
742         * Makefile (unload): Don't link in libpthread.so.
743         ($(objpfx)unload.out): Do depend on it.
744         * unload.c (main): Improve error reporting.
745
746 2002-10-09  Roland McGrath  <roland@redhat.com>
747
748         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
749         Under [__PIC__], call the function via the pointer fetched for
750         comparison rather than a call by name that uses the PLT.
751         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
752         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
753         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
754         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
755         (__libc_key_create, __libc_getspecific, __libc_setspecific)
756         (__libc_atfork): Use it.
757
758         * pthread.c [SHARED] (__libc_dl_error_tsd): New function.
759         (pthread_initialize) [SHARED]: Set _dl_error_catch_tsd to that.
760         * Versions (libc: GLIBC_PRIVATE): Add __libc_dl_error_tsd.
761         (ld: GLIBC_PRIVATE): Set removed.
762
763 2002-10-11  Ulrich Drepper  <drepper@redhat.com>
764
765         * sysdeps/unix/sysv/linux/execve.c: New file.
766
767 2002-10-09  Jakub Jelinek  <jakub@redhat.com>
768
769         * no-tsd.c: Include stdlib.h.
770
771 2002-10-07  Jakub Jelinek  <jakub@redhat.com>
772
773         * sysdeps/unix/sysv/linux/allocalim.h: New file.
774         * descr.h (struct _pthread_descr_struct): Add p_alloca_cutoff
775         field.
776         * manager.c (__pthread_allocate_stack): Add out_stacksize argument.
777         Pass stack size to caller.
778         (pthread_handle_create): Set p_alloca_cutoff.
779         * pthread.c (__pthread_initial_thread): Use C99 designated
780         initializers.  Set p_alloca_cutoff.
781         (__pthread_manager_thread): Likewise.
782         (__pthread_initialize_minimal) [USE_TLS]: Set p_alloca_cutoff
783         for initial thread.
784         (__pthread_init_max_stacksize): Possibly decrease p_alloca_cutoff
785         for initial thread.
786         (__pthread_initialize_manager) [USE_TLS]: Set p_alloca_cutoff
787         for manager thread.
788         * specific.c (__libc_alloca_cutoff): New function.
789         * no-tsd.c (__libc_alloca_cutoff): New function.
790         * Versions: Export __libc_alloca_cutoff@@GLIBC_PRIVATE from libc
791         and libpthread.
792
793 2002-10-02  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
794
795         * sysdeps/sh/pt-machine.h: Make C code ifndef'ed with __ASSEMBLER__.
796         * sysdeps/sh/tls.h: Likewise.
797         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
798
799 2002-09-29  Jakub Jelinek  <jakub@redhat.com>
800
801         * sysdeps/pthread/tst-timer.c (main): Clear
802         SIGEV2.sigev_notify_attributes.
803
804 2002-09-29  Ulrich Drepper  <drepper@redhat.com>
805
806         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Don't use
807         INLINE_SYSCALL for set_thread_area syscall.
808
809 2002-09-28  Roland McGrath  <roland@redhat.com>
810
811         * pthread.c (__pthread_reset_main_thread) [FLOATING_STACKS]:
812         Don't call setrlimit, since we did no prior bogon we need to undo.
813
814 2002-09-27  Roland McGrath  <roland@redhat.com>
815
816         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Don't include <pt-machine.h>.
817
818 2002-09-24  Roland McGrath  <roland@redhat.com>
819
820         * sysdeps/x86_64/tls.h: New file.
821
822 2002-09-23  Roland McGrath  <roland@redhat.com>
823
824         * Examples/ex13.c (dump_mut): int -> size_t for counter.
825
826 2002-09-18  Bruno Haible  <bruno@clisp.org>
827
828         * Examples/ex10.c (thread): Fail if pthread_mutex_timedlock() returns
829         an unexpected error code.
830
831         * internals.h (__pthread_message): Add const to first parameter type.
832         * pthread.c (__pthread_message): Likewise.
833
834         * sysdeps/unix/sysv/linux/configure: Moved to ../sysdeps/pthread.
835
836 2002-09-17  Roland McGrath  <roland@redhat.com>
837
838         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT, TLS_DO_SET_THREAD_AREA):
839         Set the descriptor limit to the full 4GB, so %gs:OFFSET works for any
840         offset (positive or negative) relative to the thread struct.
841         * sysdeps/i386/useldt.h (DO_MODIFY_LDT, DO_SET_THREAD_AREA): Likewise.
842
843 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
844
845         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Move...
846         * sysdeps/unix/sysv/linux/sparc/Makefile: ...here.
847         Replace /usr/lib/crt[in].o with crt[in].o too.
848
849 2002-09-11  Steven Munroe  <sjmunroe@us.ibm.com>
850
851         * sysdeps/powerpc/powerpc64/pt-machine.h: New file.
852
853 2002-09-04  Bruno Haible  <bruno@clisp.org>
854
855         * pthread.c: Include <sys/time.h>.
856         (is_smp_system): Move to sysdeps/unix/sysv/linux/smp.h.
857         * sysdeps/unix/sysv/linux/smp.h: New file, extracted from pthread.c.
858         * Makefile (distribute): Add smp.h to the list.
859
860 2002-09-04  Bruno Haible  <bruno@clisp.org>
861
862         * sysdeps/alpha/pt-machine.h: Choose different include file location
863         on non-Linux platforms.
864
865         * wrapsyscall.c (PROMOTE_INTEGRAL_TYPE): New macro.
866         (open, open64): Change va_arg argument type to the integral type to
867         which mode_t promotes.
868
869         * sysdeps/pthread/tst-timer.c (main): Don't assume anything about
870         the structure of 'struct sigevent'.
871
872         * errno.c (__errno_location, __h_errno_location, __res_state):
873         Use prototype function definitions.
874
875 2002-07-29  Steven Munroe  <sjmunroe@us.ibm.com>
876
877         * shlib-versions: Set libpthread version to 2.3 for powerpc64.
878         * sysdeps/powerpc/pt-machine.h: moved to...
879         * sysdeps/powerpc/powerpc32/pt-machine.h: ...here
880         * sysdeps/powerpc/powerpc64/pt-machine.h: New file.
881
882 2002-09-02  Roland McGrath  <roland@redhat.com>
883
884         * sysdeps/powerpc/Makefile (CFLAGS-pt-initfini.s): New variable.
885
886 2002-09-01  Roland McGrath  <roland@redhat.com>
887
888         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t): Add new keys
889         CTYPE_B, CTYPE_TOLOWER, CTYPE_TOUPPER.
890
891         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_address): New macro.
892         (__libc_internal_tsd_address): Declare it.
893         * Versions (libc, ld, libpthread: GLIBC_PRIVATE): Add
894         __libc_internal_tsd_address.
895         * specific.c (libc_internal_tsd_address): New function.
896         (__libc_internal_tsd_address): New variable.
897         * no-tsd.c (__libc_internal_tsd_address): New variable.
898
899 2002-08-31  Ulrich Drepper  <drepper@redhat.com>
900
901         * Makefile: Don't use rule for crt%.o, spell it out as rules for
902         crti.o and crtn.o.
903
904 2002-08-30  Roland McGrath  <roland@redhat.com>
905
906         * Makefile (extra-objs, omit-deps): Add crtn.
907         ($(objpfx)libpthread.so): Depend on $(objpfx)crtn.o.
908         ($(objpfx)libpthread.so: +postinit): Append $(objpfx)crtn.o.
909         ($(objpfx)crtn.S): New target.
910         ($(objpfx)crt%.o): Pattern rule replaces crti.o target.
911         (generated): Add crtn.S.
912
913         * sysdeps/unix/sysv/linux/x86_64/Makefile ($(objpfx)specs): Massage
914         crtn.o pathname too.
915
916 2002-08-30  Jakub Jelinek  <jakub@redhat.com>
917
918         * pthread.c (__pthread_initialize_minimal): Call __uselocale even
919         if [! SHARED].
920
921 2002-08-30  Roland McGrath  <roland@redhat.com>
922
923         * tst-static-locale.c: New file.
924         * Makefile (tests, tests-static): Add it.
925
926 2002-04-24  Steven Munroe  <sjmunroe@us.ibm.com>
927
928         * spinlock.c (__pthread_lock): Fix spurious wakeup
929         handling.  Don't clear lowest bit of list pointer as sign the thread
930         is still on the wait list.  Don't restart after spurious wakeup
931         with spinning to get the lock.
932         (__pthread_unlock): Take set lowest bit into account when handling
933         pointer to list elements.
934         Patch by Steve Munroe <sjmunroe@us.ibm.com>.
935
936 2002-08-28  Roland McGrath  <roland@redhat.com>
937
938         * sysdeps/pthread/timer_routines.c (thread_func): Fix type in cast.
939
940 2002-08-28  Jakub Jelinek  <jakub@redhat.com>
941
942         * sysdeps/unix/sysv/linux/hppa/aio_cancel.c: New file.
943         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
944         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
945
946 2002-08-28  Ulrich Drepper  <drepper@redhat.com>
947
948         * sysdeps/pthread/timer_routines.c (thread_func): Change return
949         type to void and add casts in use to avoid warnings with all gcc
950         versions.
951
952 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
953
954         * sysdeps/unix/sysv/linux/bits/local_lim.h (PTHREAD_THREADS_MAX):
955         Bump to 16384.
956         * manager.c (__pthread_handles): Remove.
957         * pthandles.c: New file.
958         * pthread.c (__pthread_initialize_minimal): Initialize
959         __pthread_handles[0] and __pthread_handles[1].
960         * Makefile (libpthread-routines): Add pthandles (must be last).
961
962 2002-08-26  Brian Youmans  <3diff@gnu.org>
963
964         * Examples/ex10.c: Corrected version number in Lesser GPL copying
965         permission notice from 2 to 2.1.
966         * Examples/ex11.c: Likewise.
967         * Examples/ex13.c: Likewise.
968         * Examples/ex8.c: Likewise.
969         * Examples/ex9.c: Likewise.
970         * barrier.c: Likewise.
971         * events.c: Likewise.
972         * lockfile.c: Likewise.
973         * no-tsd.c: Likewise.
974         * pt-machine.c: Likewise.
975         * ptclock_gettime.c: Likewise.
976         * ptclock_settime.c: Likewise.
977         * rwlock.c: Likewise.
978         * sysdeps/alpha/pspinlock.c: Likewise.
979         * sysdeps/alpha/pt-machine.h: Likewise.
980         * sysdeps/arm/pspinlock.c: Likewise.
981         * sysdeps/arm/pt-machine.h: Likewise.
982         * sysdeps/cris/pspinlock.c: Likewise.
983         * sysdeps/cris/pt-machine.h: Likewise.
984         * sysdeps/hppa/pspinlock.c: Likewise.
985         * sysdeps/hppa/pt-machine.h: Likewise.
986         * sysdeps/i386/i686/pt-machine.h: Likewise.
987         * sysdeps/i386/pspinlock.c: Likewise.
988         * sysdeps/i386/pt-machine.h: Likewise.
989         * sysdeps/i386/useldt.h: Likewise.
990         * sysdeps/ia64/pspinlock.c: Likewise.
991         * sysdeps/ia64/pt-machine.h: Likewise.
992         * sysdeps/m68k/pspinlock.c: Likewise.
993         * sysdeps/m68k/pt-machine.h: Likewise.
994         * sysdeps/mips/pspinlock.c: Likewise.
995         * sysdeps/mips/pt-machine.h: Likewise.
996         * sysdeps/powerpc/pspinlock.c: Likewise.
997         * sysdeps/powerpc/pt-machine.h: Likewise.
998         * sysdeps/pthread/bits/initspin.h: Likewise.
999         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1000         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
1001         * sysdeps/pthread/getcpuclockid.c: Likewise.
1002         * sysdeps/pthread/posix-timer.h: Likewise.
1003         * sysdeps/pthread/timer_create.c: Likewise.
1004         * sysdeps/pthread/timer_delete.c: Likewise.
1005         * sysdeps/pthread/timer_getoverr.c: Likewise.
1006         * sysdeps/pthread/timer_gettime.c: Likewise.
1007         * sysdeps/pthread/timer_routines.c: Likewise.
1008         * sysdeps/pthread/timer_settime.c: Likewise.
1009         * sysdeps/pthread/tst-timer.c: Likewise.
1010         * sysdeps/s390/pspinlock.c: Likewise.
1011         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
1012         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
1013         * sysdeps/sh/pspinlock.c: Likewise.
1014         * sysdeps/sh/pt-machine.h: Likewise.
1015         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
1016         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
1017         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
1018         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
1019         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1020         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
1021         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1022         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
1023         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
1024         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1025         * tststack.c: Likewise.
1026         * unload.c: Likewise.
1027         * weaks.c: Likewise.
1028         * wrapsyscall.c: Likewise.
1029
1030         * sysdeps/pthread/pt-initfini.c: Changed copying
1031         permission notice to Lesser GPL from Library GPL, including the
1032         references in the special exception.
1033         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: Likewise.
1034         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Likewise.
1035         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c:
1036         Likewise.
1037         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c:
1038         Likewise.
1039         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Likewise.
1040
1041 2002-08-26  Ulrich Drepper  <drepper@redhat.com>
1042
1043         * Examples/ex10.c (thread): tv_nsec == 1000000000 is already
1044         overflow [PR libc/4244].
1045
1046 2002-08-25  Ulrich Drepper  <drepper@redhat.com>
1047
1048         * sysdeps/pthread/timer_routines.c (thread_func): Make the
1049         compiler happy by adding a return statement which will never be
1050         reached.
1051
1052         * tst-context.c (main): Cast to long before casting to pointer.
1053
1054         * Examples/ex17.c (main): Use correct format string.
1055
1056         * Examples/ex9.c (thread): Remove incorrect return statement.
1057
1058 2002-08-23  Ulrich Drepper  <drepper@redhat.com>
1059
1060         * pthread.c (__linuxthreads_version): New global constant.
1061
1062 2002-08-23  Andreas Jaeger  <aj@suse.de>
1063
1064         * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
1065         as thread specific register.
1066         (testandset): Fix inline asm.
1067         (THREAD_GETMEM): Fix inline asm.
1068
1069 2002-08-22  Roland McGrath  <roland@redhat.com>
1070
1071         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
1072         conditional.
1073         (INIT_THREAD_SELF): Pass second arg to DO_SET_THREAD_AREA.
1074         (DO_SET_THREAD_AREA): Take second arg, pass to DO_SET_THREAD_AREA_REUSE
1075         macro.  That chooses whether to reuse %gs value or let kernel set it.
1076         [USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, always 1.
1077         [!USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, true if arg is
1078         not constant 0.
1079
1080 2002-08-21  Ulrich Drepper  <drepper@redhat.com>
1081
1082         * sysdeps/i386/tls.h (TLS_SETUP_GS_SEGMENT): Add new parameter
1083         also to the third definition of this macro.
1084
1085 2002-06-17  Andreas Jaeger  <aj@suse.de>
1086
1087         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1088         Set it.
1089
1090 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
1091
1092         * sysdeps/i386/useldt.h: Go back to using 16-bit instructions when
1093         loading/reading segment registers.  Some old hardware doesn't
1094         handle the 32-bit instructions as expected.
1095         * sysdeps/i386/tls.h: Likewise.
1096
1097         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
1098         renamed to secondcall and use is negated.
1099         (TLS_SETUP_GS_SEGMENT): Likewise.
1100         (TLS_INIT_TP): Likewise.
1101         * sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
1102         secondcall.
1103
1104         * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
1105         registers.  No need to mask upper 16 bits in this case.
1106         * sysdeps/i386/useldt.h: Likewise.
1107         (DO_SET_THREAD_AREA): We have to load %gs again even if the value
1108         is the same since the GDT content changed.
1109
1110         * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
1111         to TLS_SETUP_GS_SEGMENT.
1112         (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
1113         TLS_DO_SET_THREAD_AREA.
1114         (TLS_DO_SET_THREAD_AREA): If new parameter is zero determine
1115         entry number from %gs value.
1116         * sysdeps/sh/tls.h (TLS_INIT_TP): Add new parameter and simply
1117         ignore it.
1118
1119         * manager.c (pthread_handle_create): Pass NULL to _dl_allocate_tls.
1120         Pass true to _dl_deallocate_tls.
1121         (pthread_free): Likewise.
1122         * pthread.c (__pthread_initialize_manager): Likewise.
1123
1124 2002-08-19  Ulrich Drepper  <drepper@redhat.com>
1125
1126         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Use correct shift when
1127         computing index from %gs value.
1128
1129 2002-08-16  Roland McGrath  <roland@redhat.com>
1130
1131         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Calculate segment
1132         register value from entry number properly.
1133
1134         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Rewrite asm to use %ebx
1135         optimally conditional on [__PIC__].
1136         (TLS_DO_SET_THREAD_AREA): New macro, implement inline syscall
1137         without touching errno, and use latest modify_ldt-like interface.
1138         (TLS_SETUP_GS_SEGMENT): Use that instead of INLINE_SYSCALL.
1139         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Set %gs in this macro.
1140         (DO_SET_THREAD_AREA): New macro, uses current syscall interface with
1141         existing %gs value as the segment to set.
1142         (INIT_THREAD_SELF): Rewritten using those.  Use set_thread_area only
1143         under [HAVE_TLS_SUPPORT] so we can rely on the initialization done
1144         by the first thread's early TLS setup.
1145
1146 2002-08-15  Roland McGrath  <roland@redhat.com>
1147
1148         * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
1149         return a value as callers now expect.
1150
1151 2002-08-11  Roland McGrath  <roland@redhat.com>
1152
1153         * pthread.c (__pthread_initialize_manager): Initialize
1154         p_header.data.tcb field of manager thread's descriptor.
1155         (__pthread_initialize_minimal): Don't initialize p_header.data.self
1156         field, already done by TLS_INIT_TP.
1157
1158         * manager.c (pthread_handle_create): Move p_header field initializers
1159         together.
1160
1161 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
1162
1163         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
1164
1165 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
1166
1167         * pthread.c (__linuxthreads_initial_report_events): New variable.
1168         (__pthread_initialize_manager): Use it to initialize p_report_events
1169         of initial thread.
1170         [TLS]: Store pointer to descriptor of manager in __pthread_handles.
1171
1172 2002-08-07  Roland McGrath  <roland@redhat.com>
1173
1174         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Add an extra argument with
1175         an "m" constraint to the asm so the compiler knows LDT_ENTRY was used.
1176
1177 2002-08-02  Roland McGrath  <roland@redhat.com>
1178
1179         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t):
1180         Add _LIBC_TSD_KEY_LOCALE.
1181         * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
1182         Call __uselocale to initialize our per-thread locale pointer to
1183         the global one.
1184         * pthread.c (__pthread_initialize_minimal): Likewise.
1185
1186         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Add missing \s.
1187
1188 2002-08-02  Ulrich Drepper  <drepper@redhat.com>
1189
1190         * pthread.c: Declare _errno, _h_errno, and _res unless we use TLS
1191         internally.
1192
1193         * cancel.c (__pthread_perform_cleanup) [USE_TLS && HAVE___THREAD]:
1194         Don't use p_libc_specific element in thread descriptor.
1195
1196 2002-07-30  Roland McGrath  <roland@redhat.com>
1197
1198         * sysdeps/pthread/bits/libc-tsd.h: Include <tls.h>.
1199         [USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
1200         which does the right thing when __thread support is available.
1201         * descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
1202         Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
1203         `p_h_errno', `p_resp', and `p_res' members.
1204         * pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
1205         Don't initialize `p_errnop' and `p_h_errnop' members.
1206         (__pthread_reset_main_thread): Likewise.
1207         (__pthread_initialize_manager): Likewise.
1208         * manager.c (__pthread_manager, pthread_handle_create): Likewise.
1209         * pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
1210         Don't initialize `p_resp' member.
1211         (__pthread_reset_main_thread): Likewise.
1212         * manager.c (pthread_handle_create): Likewise.
1213         * specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
1214         Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
1215         * no-tsd.c: Conditionalize contents on [!(USE_TLS && HAVE___THREAD)].
1216         * errno.c [USE_TLS && HAVE___THREAD]
1217         (__h_errno_location, __res_state): Don't define these at all.
1218
1219         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
1220         (INSTALL_NEW_DTV, GET_DTV): Likewise.
1221         * sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
1222
1223         * weaks.c: Don't include <errno.h> here.
1224
1225 2002-08-01  Roland McGrath  <roland@redhat.com>
1226
1227         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
1228         TLS_INIT_TP.
1229         (TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
1230         (TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
1231         (TLS_INIT_TP): Use that.
1232
1233 2002-08-02  Jakub Jelinek  <jakub@redhat.com>
1234
1235         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Move from INIT_THREAD_SELF.
1236         (INIT_THREAD_SELF): Use sys_thread_area syscall instead if available.
1237         (FREE_THREAD): Avoid modify_ldt if using GDT.
1238         * sysdeps/i386/pspinlock.c (__have_no_set_thread_area): New variable.
1239
1240 2002-07-25  Jakub Jelinek  <jakub@redhat.com>
1241
1242         * sysdeps/i386/tls.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
1243         * sysdeps/i386/pt-machine.h: Likewise.
1244         * sysdeps/i386/useldt.h: Likewise.
1245
1246 2002-07-22  Ulrich Drepper  <drepper@redhat.com>
1247
1248         * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
1249         call __libc_setup_tls first.
1250         * Makefile: Actually create tst-signal.out file when running the test.
1251         (tests): Add tststatic.
1252         * Examples/tststatic.c: New file.
1253
1254 2002-07-19  Ulrich Drepper  <drepper@redhat.com>
1255
1256         * errno.c (__errno_location): Don't define unless !USE_TLS
1257         || !HAVE___THREAD.
1258         * sysdeps/i386/pt-machine.c: Protect C code with #ifndef ASSEMBLER.
1259         * sysdeps/i386/tls.h: Likewise.
1260         * sysdeps/i386/useldt.h: Likewise.
1261         * sysdeps/i386/i686/pt-machine.h: Likewise.
1262
1263 2002-07-02  H.J. Lu  <hjl@gnu.org>
1264
1265         * sysdeps/mips/pspinlock.c: Don't include <sgidefs.h>.  Always
1266         use ll/sc.
1267         * sysdeps/mips/pt-machine.h: Likewise.
1268
1269 2002-07-14  Ulrich Drepper  <drepper@redhat.com>
1270
1271         * manager.c (pthread_handle_create): Initialize self-reference in
1272         descriptor.
1273
1274 2002-07-01  Jakub Jelinek  <jakub@redhat.com>
1275
1276         * Examples/ex9.c (main): Remove unused th variable.
1277
1278 2002-07-10  Ulrich Drepper  <drepper@redhat.com>
1279
1280         * wrapsyscall.c: Add __nanosleep alias.
1281         * Versions (GLIBC_2.2.6): Add __nanosleep.
1282         * bug-sleep.c: New file.
1283         * Makefile (tests): Add bug-sleep.
1284
1285 2002-06-19  Steven Munroe  <sjmunroe@vnet.ibm.com>
1286
1287         * Examples/ex9.c (main):  Use list of children and join them.
1288         (thread): Do not call exit.
1289
1290 2002-06-20  Ulrich Drepper  <drepper@redhat.com>
1291
1292         * spinlock.c (wait_node_alloc): We cannot use compare-and-exchange.
1293         Unconditionally use the code using spinlock.  Use __pthread_release
1294         to free a spinlock.
1295         (wait_node_free): Likewise.
1296         (__pthread_acquire, __pthread_release): Unconditionally define.
1297
1298 2002-06-07  Jakub Jelinek  <jakub@redhat.com>
1299
1300         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Fix typo.
1301
1302 2002-05-24  Ulrich Drepper  <drepper@redhat.com>
1303
1304         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Use __sync_synchronize.
1305
1306 2002-05-21  Ulrich Drepper  <drepper@redhat.com>
1307
1308         * sysdeps/pthread/pthread.h (pthread_create): Rename first
1309         parameter.
1310         (pthread_cancel): Likewise.
1311         * internals.h (__pthread_create_2_1): Likewise.
1312         * sysdeps/unix/sysv/linux/bits/sigthread.h (pthread_kill): Likewise.
1313
1314 2002-05-20  Ulrich Drepper  <drepper@redhat.com>
1315
1316         * sysdeps/alpha/pt-machine.c (THREAD_SELF): Remove clobber.
1317         Patch by Glen Nakamura <gen@flex.com>.
1318
1319 2002-05-03  Ulrich Drepper  <drepper@redhat.com>
1320
1321         * signals.c: Move sighandler functions to...
1322         * sighandler.c: ...here.  New file.
1323         * signals.c: Move signal handler related type definitions to...
1324         * internals.h: ...here.  Add prototypes for signal handlers.
1325         * Makefile (libpthread-routines): Add sighandler.
1326         (CFLAGS-sighandler.c): Add $(exceptions).
1327
1328 2002-04-30  Jakub Jelinek  <jakub@redhat.com>
1329
1330         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
1331
1332 2002-04-08  Ulrich Drepper  <drepper@redhat.com>
1333
1334         * sysdeps/pthread/timer_getoverr.c: Return real overrun.
1335         * sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
1336         * sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
1337         based on previous one and not on current time.  Count overruns.
1338         Patch by Eric F. Sorton <eric@cctcorp.com>.
1339
1340         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
1341
1342 2002-04-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1343
1344         * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
1345         if it isn't defined yet.
1346         (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
1347         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
1348         Likewise.
1349         * sysdeps/sh/tls.h: New file.
1350
1351 2002-04-08  Jakub Jelinek  <jakub@redhat.com>
1352
1353         * manager.c (__pthread_manager_event): Use self instead of arg
1354         for INIT_THREAD_SELF.
1355         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct
1356         _pthread_descr_struct) instead of sizeof (*descr).
1357
1358 2002-04-05  Ulrich Drepper  <drepper@redhat.com>
1359
1360         * sysdeps/ia64/pt-machine.h: Protect against multiple inclusion.
1361         * sysdeps/alpha/pt-machine.h: Likewise.
1362         * sysdeps/arm/pt-machine.h: Likewise.
1363         * sysdeps/cris/pt-machine.h: Likewise.
1364         * sysdeps/hppa/pt-machine.h: Likewise.
1365         * sysdeps/m68k/pt-machine.h: Likewise.
1366         * sysdeps/mips/pt-machine.h: Likewise.
1367         * sysdeps/powerpc/pt-machine.h: Likewise.
1368         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
1369         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
1370         * sysdeps/sh/pt-machine.h: Likewise.
1371         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
1372         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1373         * sysdeps/x86_64/pt-machine.h: Likewise.
1374
1375 2002-04-05  Jakub Jelinek  <jakub@redhat.com>
1376
1377         * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document
1378         instead of pthread_mutexattr_setkind_np.
1379         (pthread_mutexattr_gettype): Similarly.
1380         * man/pthread_mutexattr_setkind_np.man: New.
1381         * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man.
1382
1383 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
1384
1385         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Define.
1386
1387 2002-03-22  Jakub Jelinek  <jakub@redhat.com>
1388
1389         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Remove.
1390
1391 2002-03-22  Ulrich Drepper  <drepper@redhat.com>
1392
1393         * internals.h (MEMORY_BARRIER): Define as asm with memory as clobber.
1394
1395 2002-03-17  Andreas Jaeger  <aj@suse.de>
1396
1397         * sysdeps/i386/pt-machine.h: Add testandset and __compare_and_swap
1398         prototpyes.
1399         * sysdeps/alpha/pt-machine.h: Likewise.
1400         * sysdeps/arm/pt-machine.h: Likewise.
1401         * sysdeps/cris/pt-machine.h: Likewise.
1402         * sysdeps/hppa/pt-machine.h: Likewise.
1403         * sysdeps/i386/i686/pt-machine.h: Likewise.
1404         * sysdeps/ia64/pt-machine.h: Likewise.
1405         * sysdeps/m68k/pt-machine.h: Likewise.
1406         * sysdeps/mips/pt-machine.h: Likewise.
1407         * sysdeps/powerpc/pt-machine.h: Likewise.
1408         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
1409         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
1410         * sysdeps/sh/pt-machine.h: Likewise.
1411         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
1412         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1413         * sysdeps/x86_64/pt-machine.h: Likewise.
1414
1415         * internals.h: Move testandset and __compare_and_swap prototypes
1416         to pt-machine.h.
1417
1418 2002-03-03  Andreas Jaeger  <aj@suse.de>
1419
1420         * errno.c: Include resolv.h to avoid warning.
1421
1422 2002-02-27  Ulrich Drepper  <drepper@redhat.com>
1423
1424         * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
1425         stack limit.
1426
1427 2002-02-23  Ulrich Drepper  <drepper@redhat.com>
1428
1429         * attr.c (pthread_getattr_np): Don't take thread descriptor size
1430         into account if USE_TLS.
1431         * manager.c (pthread_handle_create): Free TLS data structures if call
1432         failed.  Pass correct stack to clone if USE_TLS.
1433         * sysdeps/i386/pt-machine.h: Handle multiple inclusion.
1434         * sysdeps/i386/i686/pt-machine.h: Likewise.
1435         * sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
1436
1437         * descr.h (struct _pthread_descr_struct): Update p_header for TLS.
1438         Add p_stackaddr element #if USE_TLS.
1439         * internals.c: Include <tls.h>.
1440         * manager.c: Integrate creating and handling of thread descriptor
1441         for TLS.
1442         * pthread.c: Likewise.
1443         * sysdeps/i386/tls.h (tcbhead_t): Add self pointer.
1444         Include <linuxthreads/descr.h> only if TLS is really used.
1445         (GET_DTV): New macro.
1446         (TLS_INIT_TP): Initialize self pointer.
1447
1448 2002-02-17  Andreas Schwab  <schwab@suse.de>
1449
1450         * signals.c (sigwait): Check for old sighandler being SIG_ERR,
1451         not NULL.
1452
1453 2002-02-12  Ulrich Drepper  <drepper@redhat.com>
1454
1455         * sysdeps/i386/tls.c (INSTALL_NEW_DTV): Define.
1456         (INSTALL_DTV): Adjust for being passed pointer to element with length.
1457
1458 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
1459
1460         * sysdeps/i386/tls.h (TLS_INIT_TP): Also initialize %gs.
1461
1462 2002-02-08  Richard Henderson  <rth@redhat.com>
1463
1464         * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string.
1465
1466 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
1467
1468         * sysdeps/i386/tls.h: TLS cannot be supported with FLOATING_STACKS
1469         after all.
1470
1471 2002-02-07  H.J. Lu  <hjl@gnu.org>
1472
1473         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Silence the
1474         gcc warning.
1475         (__pthread_spin_lock): Remove ".set noreorder".
1476         * sysdeps/mips/pt-machine.h (__compare_and_swap): Liekwise.
1477
1478 2002-02-05  H.J. Lu  <hjl@gnu.org>
1479
1480         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Not use
1481         branch likely.
1482         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1483         (__compare_and_swap): Likewise.
1484
1485 2002-02-07  Ulrich Drepper  <drepper@redhat.com>
1486
1487         * internals.h: Move declarations/definitions of
1488         __pthread_initial_thread_bos, __pthread_initial_thread,
1489         __pthread_manager_thread_bos, __pthread_manager_thread_tos,
1490         __pthread_manager_thread, __pthread_nonstandard_stacks, STACK_SIZE,
1491         CURRENT_STACK_FRAME, __pthread_find_self, and thread_self...
1492         * descr.h: ...here.
1493         * sysdeps/i386/tls.h: Add TLS definitions also for !FLOATING_STACKS.
1494         Define THREAD_GETMEM accordingly.
1495
1496 2002-02-06  Ulrich Drepper  <drepper@redhat.com>
1497
1498         * sysdeps/i386/tls.h: Include <stddef.h> for size_t.
1499
1500         * sysdeps/i386/tls.h: Define THREAD_DTV.
1501
1502 2002-02-04  Ulrich Drepper  <drepper@redhat.com>
1503
1504         * internals.h: Move thread descriptor definition...
1505         * descr.h.: ...here.  New file.
1506         * sysdeps/i386/tls.h: New file.
1507
1508 2002-02-01  H.J. Lu  <hjl@gnu.org>
1509
1510         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Use a
1511         different register in the delayed slot.  Use branch likely.
1512
1513         * sysdeps/mips/pt-machine.h (testandset): Call _test_and_set.
1514         (__compare_and_swap): Return 0 only when failed to compare. Use
1515         branch likely.
1516
1517 2002-02-01  Jakub Jelinek  <jakub@redhat.com>
1518
1519         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set,
1520         __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE.
1521         * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE.
1522         * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE.
1523         * sysdeps/sparc/sparc32/sparcv9/Versions: New file.
1524         * sysdeps/sparc/sparc64/Versions: New file.
1525         * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE.
1526
1527 2002-01-31  Ulrich Drepper  <drepper@redhat.com>
1528
1529         * pthread.c: _dl_cpuclock_offset is not any longer a global variable
1530         in SHARED code, use GL(dl_cpuclock_offset).
1531
1532 2002-01-28  Andreas Jaeger  <aj@suse.de>
1533
1534         * sysdeps/mips/pspinlock.c (__pthread_spin_init): Clear *LOCK to
1535         0. Patch by Machida Hiroyuki <machida@sm.sony.co.jp>.
1536
1537 2002-01-16  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1538
1539         * sysdeps/s390/s390-32/pt-machine.h (MEMORY_BARRIER): Define.
1540         (CURRENT_STACK_FRAME): Remove duplicate definition.
1541         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
1542
1543 2002-01-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1544
1545         * Makefile (CFLAGS-tst-cancel.c): Add -fno-inline-functions to prevent
1546         automatic inline.
1547
1548 2002-01-12  Andreas Schwab  <schwab@suse.de>
1549
1550         * Makefile (test-srcs): Add tst-signal.
1551         (tests): Run tst-signal.
1552         (distribute): Add tst-signal.sh.
1553         * tst-signal.c, tst-signal.sh: New files.
1554
1555 2002-01-14  Andreas Jaeger  <aj@suse.de>
1556
1557         * sysdeps/x86_64/pt-machine.h (INIT_THREAD_SELF): Avoid warning.
1558
1559 2002-01-11  Andreas Schwab  <schwab@suse.de>
1560
1561         * signals.c (sighandler): Initialize all elements to SIG_ERR.
1562         (__sigaction): Don't use value from sighandler if it is SIG_ERR.
1563
1564 2002-01-06  Richard Henderson  <rth@redhat.com>
1565
1566         * sysdeps/alpha/elf/pt-initfini.c: New file.
1567
1568 2001-12-29  Andreas Jaeger  <aj@suse.de>
1569
1570         * Examples/ex9.c: Add noreturn attribute for thread.
1571         * Examples/ex10.c: Likewise.
1572         * Examples/ex13.c (thread_start): Likewise.
1573         * Examples/ex15.c (worker): Likewise.
1574
1575         * Examples/ex18.c: Include unistd.h for prototype of sleep.
1576
1577 2001-12-14  Ulrich Drepper  <drepper@redhat.com>
1578
1579         * man/pthread_atfork.man: Adjust description of mutex handling
1580         after fork for current implementation.
1581         * linuxthreads.texi: Likewise [PR libc/2519].
1582
1583 2001-12-13  Andreas Schwab  <schwab@suse.de>
1584
1585         * specific.c (pthread_key_delete): Don't contact the thread
1586         manager if no threads have been created yet.
1587
1588 2001-12-12  NIIBE Yutaka  <gniibe@m17n.org>
1589
1590         * sysdeps/sh/pt-machine.h (INIT_THREAD_SELF): Added __volatile__
1591         qualifier to be safe.
1592
1593 2001-11-30  Andreas Schwab  <schwab@suse.de>
1594
1595         * pthread.c (pthread_handle_sigcancel) [THREAD_SELF]: Double check
1596         that self is the manager thread, and initialize the thread
1597         register if not.
1598         (thread_self_stack) [THREAD_SELF]: New function to find self via
1599         stack pointer.
1600         * manager.c (pthread_handle_create): Don't block cancel signal any
1601         more.
1602
1603 2001-11-29  Andreas Jaeger  <aj@suse.de>
1604
1605         * sysdeps/x86_64/pt-machine.h: Use %gs as thread specific register.
1606         (THREAD_SELF): New.
1607         (INIT_THREAD_SELF): New.
1608         (THREAD_GETMEM): New.
1609         (THREAD_GETMEM_NC):
1610         (THREAD_SETMEM): New.
1611         (THREAD_SETMEM_NC): New.
1612         (FLOATING_STACKS): Define.
1613         (ARCH_STACK_MAX_SIZE): Define.
1614
1615 2001-11-28  Kaz Kylheku  <kaz@ashi.footprints.net>
1616
1617         Bugfix to pthread_key_delete. It was iterating over the thread
1618         manager's linked list of threads, behind the thread manager's
1619         back causing a race. The fix is to have the manager iterate over
1620         the threads instead, using a new request type for doing so.
1621         * internals.h (struct pthread_request): New manager request type
1622         REQ_FOR_EACH_THREAD.
1623         * manager.c (pthread_for_each_thread): New function.
1624         (__pthread_manager): Handle new REQ_FOR_EACH_THREAD request.
1625         * specific.c (struct pthread_key_delete_helper_args): New type.
1626         (pthread_key_delete_helper): New static function.
1627         (pthread_key_delete): Use the new thread manager
1628         REQ_FOR_EACH_THREAD function to iterate over the threads and set
1629         the delete key slot to a null value in each thread.
1630         * Examples/ex18.c: New test.
1631         * Makefile (tests): Add ex18.
1632
1633 2001-11-22  Wolfram Gloger  <wg@malloc.de>
1634
1635         * pthread.c (pthread_onexit_process): Don't call free
1636         after threads have been asynchronously terminated.
1637
1638         * manager.c (pthread_handle_exit): Surround cancellation
1639         of threads with __flockfilelist()/__funlockfilelist().
1640
1641 2001-11-26  Andreas Schwab  <schwab@suse.de>
1642
1643         * manager.c (pthread_handle_create): Start the child thread with
1644         the cancel signal blocked, so that it does not handle it before
1645         the thread register is set up.  Save errno from failed clone call.
1646
1647 2001-11-15  Ulrich Drepper  <drepper@redhat.com>
1648
1649         * sysdeps/i386/i686/Implies: Removed.
1650         * sysdeps/i386/i686/Versions: New file.
1651
1652 2001-10-31  Andreas Jaeger  <aj@suse.de>
1653
1654         * sysdeps/x86_64/Makefile: Remove, we do not need it anymore.
1655
1656 2001-10-05  Kevin Buettner  <kevinb@cygnus.com>
1657
1658         * pthread.c (__linuxthread_pthread_sizeof_descr): Change name
1659         to __linuxthreads_pthread_sizeof_descr to match name used by
1660         symbol_list_arr[LINUXTHREADS_PTHREAD_SIZEOF_DESCR] in
1661         linuxthreads_db/td_symbol_list.c.
1662
1663 2001-09-22  Andreas Jaeger  <aj@suse.de>
1664
1665         * linuxthreads/tst-context.c: Avoid compile warning.
1666
1667 2001-09-20  Andreas Jaeger  <aj@suse.de>
1668
1669         * shlib-versions: Add x86-64.
1670
1671 2001-09-19  Andreas Jaeger  <aj@suse.de>
1672
1673         * sysdeps/x86_64/Makefile: New file.
1674         * sysdeps/x86_64/pspinlock.c: New file.
1675         * sysdeps/x86_64/pt-machine.h: New file.
1676
1677 2001-09-12  Jakub Jelinek  <jakub@redhat.com>
1678
1679         * sysdeps/pthread/timer_delete.c (timer_delete): Thread may be NULL
1680         for SIGEV_NONE.
1681         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
1682
1683 2001-09-11  Ulrich Drepper  <drepper@redhat.com>
1684             Wolfram Gloger <wg@malloc.de>
1685
1686         * join.c: Protect all communications from and to manager with
1687         TEMP_FAILURE_RETRY.
1688         * manager.c: Likewise.
1689         * pthread.c: Likewise.
1690         * smeaphore.c: Likewise.
1691
1692 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
1693
1694         * spinlock.c (__pthread_lock): Top max_count value with
1695         MAX_ADAPTIVE_SPIN_COUNT.
1696         * internals.h (MAX_ADAPTIVE_SPIN_COUNT): Define if not already done.
1697
1698         * sysdeps/i386/i686/pt-machine.h (BUSY_WAIT_NOP): New macro to
1699         help P4.
1700
1701 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
1702
1703         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
1704         non-opaque type if __USE_UNIX98.
1705
1706 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
1707
1708         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
1709         non-opaque lock types also if _IO_MTSAFE_IO is defined.
1710
1711 2001-08-23  Roland McGrath  <roland@frob.com>
1712
1713         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start): Take
1714         new first argument, skip the cleanup handler if it's zero.
1715         (_LIBC_LOCK_RECURSIVE_INITIALIZER): New macro.
1716         (__libc_lock_define_initialized_recursive): Use it.
1717         * sysdeps/pthread/bits/stdio-lock.h: File removed.
1718         The sysdeps/generic file from the main tree now suffices.
1719
1720 2001-08-22  Roland McGrath  <roland@frob.com>
1721
1722         * sysdeps/pthread/bits/stdio-lock.h: Include <bits/libc-lock.h>
1723         instead of <pthread.h>.
1724         (_IO_lock_t): Define this typedef using __libc_lock_define_recursive.
1725         (_IO_lock_initializer): Add braces.
1726         (_IO_lock_lock): Use __libc_lock_lock_recursive.
1727         (_IO_lock_unlock): Use __libc_lock_unlock_recursive.
1728
1729         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_recursive_t): New type.
1730         (__libc_lock_define_initialized_recursive): Use it.
1731         (__libc_lock_init_recursive): Likewise.
1732         (__libc_lock_fini_recursive): Likewise.
1733         (__libc_lock_lock_recursive): Likewise.
1734         (__libc_lock_trylock_recursive): Likewise.
1735         (__libc_lock_unlock_recursive): Likewise.
1736         (__libc_lock_define_recursive): New macro.
1737
1738 2001-08-14  Jakub Jelinek  <jakub@redhat.com>
1739
1740         * lockfile.c (__pthread_provide_lockfile): New variable.
1741         * pthread.c (__pthread_require_lockfile): New variable.
1742         * cancel.c (__pthread_require_lockfile): New variable.
1743
1744 2001-07-31  Ulrich Drepper  <drepper@redhat.com>
1745
1746         * tst-context.c (threadfct): Initialize context before calling
1747         makecontext.
1748
1749         * Examples/ex17.c: Make sure test thread is around long enough.
1750
1751 2001-07-26  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1752
1753         * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
1754
1755 2001-07-24  Ulrich Drepper  <drepper@redhat.com>
1756
1757         * tst-context.c (main): Print explanation before bailing out
1758         because context handling is not supported.
1759
1760 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
1761
1762         * Makefile (tests): Add tst-context.
1763         * tst-context.c: New file.
1764
1765         * sysdeps/pthread/bits/stdio-lock.h: Define
1766         _IO_cleanup_region_start_noarg.
1767
1768 2001-07-23  Jakub Jelinek  <jakub@redhat.com>
1769
1770         * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
1771         (ARCH_STACK_MAX_SIZE): Define.
1772         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
1773         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1774
1775 2001-07-19  Jakub Jelinek  <jakub@redhat.com>
1776
1777         * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
1778
1779         * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
1780         (ARCH_STACK_MAX_SIZE): Define.
1781         * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
1782         NEED_SEPARATE_REGISTER_STACK.
1783
1784 2001-07-16  Andreas Schwab  <schwab@suse.de>
1785
1786         * Makefile (before-compile): Don't add $(objpfx)crti.o.
1787         (omit-deps): Add crti.
1788         ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
1789         it is filtered out of the link command.
1790
1791 2001-07-16  Ulrich Drepper  <drepper@redhat.com>
1792
1793         * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
1794         to find the right value for __pthread_initial_thread_bos, it's not
1795         used.  If not FLOATING_STACKS first run
1796         __pthread_init_max_stacksize.
1797
1798 2001-06-16  H.J. Lu  <hjl@gnu.org>
1799
1800         * internals.h: Include <stackinfo.h>.
1801
1802         * attr.c: Don't include <stackinfo.h> here.
1803         * cancel.c: Likewise.
1804         * manager.c: Likewise.
1805         * pthread.c: Likewise.
1806         * ptlongjmp.c: Likewise.
1807
1808 2001-03-23  Matthew Wilcox  <willy@ldl.fc.hp.com>
1809
1810         * attr.c: Make _STACK_GROWS_UP work.
1811         * internals.h: Likewise.
1812         * manager.c: Likewise.
1813         * pthread.c: Likewise.
1814
1815 2001-06-15  H.J. Lu  <hjl@gnu.org>
1816
1817         * pthread.c (__pthread_reset_main_thread): Fix a typo.
1818
1819 2001-02-02  John S. Marvin  <jsm@udlkern.fc.hp.com>
1820
1821         * semaphore.h: Use struct _pthread_fastlock as an element of
1822         sem_t instead of an identical struct.
1823         * rwlock.c: Remove casts.
1824         * semaphore.c: Likewise.
1825
1826 2001-04-30  Alan Modra  <amodra@one.net.au>
1827
1828         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
1829
1830 2001-05-25  Bruce Mitchener  <bruce@cubik.org>
1831
1832         * linuxthreads.texi: Spelling corrections.
1833
1834 2001-05-25  Ulrich Drepper  <drepper@redhat.com>
1835
1836         * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
1837         returning successfully.
1838         Patch by Gene Cooperman <gene@ccs.neu.edu>.
1839
1840 2001-05-24  Ulrich Drepper  <drepper@redhat.com>
1841
1842         * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
1843         serious work try once whether the lock is uncontested.
1844         Remove duplicate reading of __status before loop.
1845         Change suggested by Hans Boehm <hans_boehm@hp.com>.
1846
1847         * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
1848         (__pthread_alt_trylock): Likewise.
1849
1850 2001-05-01  Kaz Kylheku  <kaz@ashi.footprints.net>
1851
1852         Memory barrier overhaul following line by line inspection.
1853         * mutex.c (pthread_once): Missing memory barriers added.
1854         * pthread.c (__pthread_wait_for_restart_signal,
1855         __pthread_timedsuspend_new, __pthread_restart_new): Added
1856         memory barriers ``just in case'' and for documentary value.
1857         * spinlock.c (__pthread_release): New inline function for releasing
1858         spinlock, to complement __pthread_acquire.  Includes memory
1859         barrier prior to assignment to spinlock, and __asm __volatile
1860         dance to prevent reordering or optimization of the spinlock access.
1861         * spinlock.c (__pthread_unlock, __pthread_alt_lock,
1862         __pthread_alt_timedlock, __pthread_alt_unlock,
1863         __pthread_compare_and_swap): Updated to use new __pthread_release
1864         instead of updating spinlock directly.
1865         * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
1866         wait_node_free, wait_node_dequeue, __pthread_alt_lock,
1867         __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
1868         Memory barrier overhaul.  Lots of missing memory barriers added,
1869         a couple needless ones removed.
1870         * spinlock.c (__pthread_compare_and_swap): testandset optimization
1871         removed, just calls __pthread_acquire, which has the new read
1872         barrier in it before its testandset.
1873
1874 2001-05-20  Roland McGrath  <roland@frob.com>
1875
1876         * Makeconfig: New file, variables used to be in main libc Makeconfig.
1877
1878 2001-05-09  Geoff Keating  <geoffk@redhat.com>
1879
1880         * sysdeps/powerpc/pt-machine.h
1881         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
1882         (__compare_and_swap): Remove memory barriers.
1883         (__compare_and_swap_with_release_semantics): New function.
1884
1885 2001-04-24  Andreas Jaeger  <aj@suse.de>
1886
1887         * wrapsyscall.c: send* and recv* return ssize_t.
1888
1889         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
1890         mutex instead of double locking it.
1891         Reported by Pierre Artaud <partaud@sodatec.com>.
1892
1893 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
1894
1895         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
1896         using #ifdef whether the clock is available.
1897         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
1898
1899         * sysdeps/ia64/Versions: New file.
1900
1901         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
1902         have to call __gmon_start__ in the libpthread DSO.
1903         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
1904
1905         * Makefile (libpthread-routines): Add ptclock_gettime and
1906         ptclock_settime.
1907         * internals.h: Don't use cpuclock-init.h definitions, use
1908         hp-timing.h definitions.
1909         * pthread.c: Likewise.
1910         * manager.c: Likewise.
1911         * ptclock_gettime.c: New file.
1912         * ptclock_settime.c: New file.
1913         * internals.h: Fix parameter type for __pthread_clock_gettime and
1914         __pthread_clock_settime.
1915
1916         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
1917         * sysdeps/i386/i586/ptclock_settime.c: Removed.
1918         * sysdeps/i386/i586/Makefile: Removed.
1919
1920 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
1921
1922         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
1923         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1924
1925 2001-04-21  Andreas Jaeger  <aj@suse.de>
1926
1927         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
1928         attribute, remove statements that will never be executed.
1929         (thread_func): Remove mutex_unlock call since it's never executed.
1930         (thread_func): Fix comment as suggested by Jakub Jelinek.
1931
1932         * manager.c (__pthread_manager): Add noreturn
1933         attribute.
1934         (pthread_start_thread): Likewise, remove return statement.
1935         (pthread_start_thread_event): Likewise.
1936         Add noreturn attribute for pthread_handle_exit.
1937         * weaks.c: Add noreturn attribute for pthread_exit.
1938
1939         * internals.h: Add __pthread_clock_gettime and
1940         __pthread_clock_settime prototypes.
1941
1942 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
1943
1944         * internals.h: Include <cpuclock-init.h>.
1945         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
1946         CPUCLOCK_VARDEF is defined.
1947         * pthread.c (__pthread_initialize_minimal): Initialize
1948         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
1949         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
1950         for new thread to current CPU clock value.
1951
1952         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
1953
1954         * sysdeps/i386/i586/Makefile: New file.
1955         * sysdeps/i386/i586/Versions: New file.
1956         * sysdeps/i386/i586/ptclock_gettime.c: New file.
1957         * sysdeps/i386/i586/ptclock_settime.c: New file.
1958         * sysdeps/i386/i686/Implies: New file.
1959
1960 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1961
1962         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
1963         $generated, not $postclean-generated.
1964
1965 2001-04-18  Andreas Jaeger  <aj@suse.de>
1966
1967         * Makefile (otherlibs): Added.
1968
1969 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1970
1971         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1972
1973 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
1974
1975         * signals.c (sigwait): NSIG is no signal number.  Block all
1976         signals while in signal handler for signals in SET.
1977         Patch by Manfred Spraul <manfred@colorfullife.com>.
1978
1979 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
1980
1981         * tst-cancel.c: Disable most tests.  Add new test where all
1982         cleanup handlers must run.
1983         * Makefile (tests): Add tst-cancel again.
1984
1985         * cancel.c (__pthread_perform_cleanup): Correct condition for
1986         leaving cleanup loop early.
1987
1988         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
1989         all the files which use CURRENT_STACK_FRAME.
1990         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
1991         __builtin_frame_address.
1992         * sysdeps/i386/i686/pt-machine.h: Likewise.
1993
1994 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1995
1996         * Makefile (tests): Comment out tst-cancel for now.
1997
1998         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
1999         temporary file in object directory.
2000         * Makefile: Don't allow inlining when compiling tst-cancel.c.
2001         Pass $(objpfx) to tst-cancel.
2002
2003 2001-04-11  David S. Miller  <davem@redhat.com>
2004
2005         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
2006         up closer to user local variables so that new cleanup heuristics work.
2007         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
2008
2009 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
2010
2011         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
2012         and remove it.
2013         (_pthread_cleanup_push_defer): Likewise.
2014
2015         * tst-cancel.c (main): Fix loop printing cleanup output.
2016
2017 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
2018
2019         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
2020         test.
2021         (__pthread_spin_trylock): Likewise.
2022         * sysdeps/sh/pt-machine.h (testandset): Likewise.
2023
2024 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
2025
2026         * join.c (pthread_exit): Move code to new function __pthread_do_exit
2027         which takes an extra parameter with the current frame pointer.
2028         Call new function with CURRENT_STACK_FRAME.
2029         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
2030         with the new parameter.
2031         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
2032         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
2033         this parameter as the initial value the cleanup handler records are
2034         compared against.  No active cleanup handler record must have an
2035         address lower than the previous one and the initial record must be
2036         above (below on PA) the frame address passed in.
2037         (pthread_setcancelstate): Call __pthread_do_exit instead of
2038         pthread_exit.
2039         (pthread_setcanceltype): Likewise.
2040         (pthread_testcancel): Likewise.
2041         (_pthread_cleanup_pop_restore): Likewise.
2042         * condvar.c (pthread_cond_wait): Likewise.
2043         (pthread_cond_timedwait_relative): Likewise.
2044         * manager.c (pthread_start_thread): Likewise.
2045         * oldsemaphore.c (__old_sem_wait): Likewise.
2046         * pthread.c (pthread_handle_sigcancel): Likewise.
2047         * semaphore.c (__new_sem_wait): Likewise.
2048         (sem_timedwait): Likewise.
2049         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
2050         to limit the cleanup handlers which get run.
2051         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
2052         for __pthread_perform_cleanup.
2053
2054         * Makefile (tests): Add tst-cancel.
2055         * tst-cancel.c: New file.
2056
2057 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
2058
2059         * sysdeps/cris/pt-machine.h: New file.
2060         * sysdeps/cris/pspinlock.c: New file.
2061
2062 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
2063
2064         * shlib-versions: Add case for Linux on CRIS.
2065
2066 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
2067
2068         * attr.c (pthread_getattr_np): Correct computation of stack size
2069         for machiens with register stack.
2070
2071         * Examples/ex17.c (main): Correct detection of failed mmap call.
2072
2073 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
2074
2075         * pthread.c (__pthread_initialize_manager): Fix a typo.
2076
2077 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
2078
2079         * attr.c (__pthread_attr_setstack): Fix alignment check.
2080         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
2081         * Makefile (tests): Add ex17 test.
2082         * Examples/ex17.c: New test.
2083
2084 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
2085
2086         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
2087         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
2088         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
2089
2090 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
2091
2092         * Makefile: When generating DSO link with libc_nonshared.a.
2093
2094 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
2095
2096         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
2097
2098 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
2099
2100         * internals.h (__pthread_init_max_stacksize): New prototype.
2101         * attr.c (__pthread_attr_setstacksize): Call
2102         __pthread_init_max_stacksize if not yet initialized.
2103         * pthread.c (__pthread_init_max_stacksize): New function.
2104         (__pthread_initialize_manager): Call it.
2105         Patch by <dtc@cmucl.cons.org>.
2106
2107 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
2108
2109         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
2110
2111 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2112
2113         * shlib-versions: Add rule for Linux on 64 bit S/390.
2114         * sysdeps/s390/s390-64/pt-machine.h: New file.
2115         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
2116
2117 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2118
2119         * sysdeps/s390/pt-machine.h: Move to...
2120         * sysdeps/s390/s390-32/pt-machine.h: ...here.
2121         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
2122
2123 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
2124
2125         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
2126         * attr.c: Implement pthread_getattr_np.
2127         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
2128         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
2129         * manager.c (pthread_handle_create): Initialize p_inheritsched.
2130
2131 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2132
2133         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
2134         code alignment.
2135
2136 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
2137
2138         * manager.c (manager_mask): Removed static vesion.  Now always local
2139         to __pthread_manager().
2140         (manager_mask_all): Removed completely.
2141         (__pthread_manager): Remove manager_mask_all initialization.
2142         (pthread_handle_create): Remove code to set and reset signal mask
2143         around __clone2() calls.
2144
2145 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
2146
2147         * spinlock.c (__pthread_lock): Force lock->__status to be read from
2148         memory on every spin.
2149
2150 2001-02-10  Andreas Jaeger  <aj@suse.de>
2151
2152         * Makefile (extra-objs): New.
2153
2154 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
2155
2156         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
2157         __pthread_initialize_minimal prototype.
2158
2159 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
2160
2161         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
2162
2163 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2164
2165         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
2166
2167 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
2168
2169         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
2170         broken code.  Patch by Jes Sorensen.
2171
2172 2001-02-06  Andreas Jaeger  <aj@suse.de>
2173
2174         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
2175         to...
2176         * internals.h: ...here.
2177
2178 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
2179
2180         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
2181
2182 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
2183
2184         * Versions: Remove __pthread_initialize_minimal.
2185
2186 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
2187
2188         * Makefile: Add rules to build crti.o and make it being used in
2189         building libpthread.so.
2190         * sysdeps/i386/Makefile: New file.
2191         * sysdeps/pthread/pt-initfini.c: New file.
2192
2193         * pthread.c: Cleanups.
2194
2195 2001-01-28  Andreas Jaeger  <aj@suse.de>
2196
2197         * oldsemaphore.c (__old_sem_init): Adjust for last change.
2198         * sysdeps/pthread/bits/libc-lock.h: Likewise.
2199         * spinlock.c: Likewise.
2200
2201 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
2202
2203         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
2204         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
2205         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
2206         * pthread.c: Likewise.
2207         * spinlock.h: Likewise.
2208         * sysdeps/pthread/pthread.h: Likewise.
2209
2210 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
2211
2212         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
2213         as struct __pthread_attr_s.
2214
2215         * semaphore.h (sem_t): Cleanup namespace, rename status and
2216         spinlock elements.
2217
2218 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
2219
2220         * pthread.c (pthread_onexit_process): Clear
2221         __pthread_manager_thread_bos after freeing it.
2222         * Makefile (tests): Add ex16.
2223         * Examples/ex16.c: New file.
2224
2225 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
2226
2227         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
2228         -z nodelete.
2229         * pthread.c (pthread_exit_process): Rename to...
2230         (pthread_onexit_process): ...this.
2231         (pthread_atexit_process, pthread_atexit_retcode): New.
2232         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
2233         and only if HAVE_Z_NODELETE is not defined.
2234         (__pthread_initialize_manager): Register pthread_atexit_retcode
2235         with __cxa_atexit.
2236
2237 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
2238
2239         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
2240
2241 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
2242
2243         * Makefile (tests): Add ex15.
2244         * Examples/ex15.c: New test.
2245
2246 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
2247
2248         * pthread.c (pthread_exit_process): Free memory allocated for
2249         manager stack.
2250
2251 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
2252
2253         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
2254         (pthread_free): Always unmap the stack.  It's safe now that we don't
2255         use MAP_FIXED to allocate stacks.
2256
2257 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
2258
2259         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
2260
2261         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
2262
2263 2000-11-15  Wolfram Gloger  <wg@malloc.de>
2264
2265         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
2266         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
2267
2268 2000-12-27  Andreas Jaeger  <aj@suse.de>
2269
2270         * Examples/ex13.c: Make local functions static.
2271         * ecmutex.c: Likewise.
2272         * joinrace.c: Likewise.
2273         * Examples/ex14.c: Likewise.
2274
2275         * Examples/ex2.c: Make local functions static; reformat.
2276         * Examples/ex1.c: Likewise.
2277         * Examples/ex4.c: Likewise.
2278         * Examples/ex5.c: Likewise.
2279         * Examples/ex7.c: Likewise.
2280
2281         * oldsemaphore.c: Add prototypes to shut up GCC.
2282         * pt-machine.c: Likewise.
2283
2284         * weaks.c: Add prototype for pthread_exit.
2285
2286         * internals.h: Add some prototypes, format prototypes and add
2287         missing externs.
2288         Move __libc_waitpid prototype to include/sys/wait.h.
2289
2290         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
2291         * mutex.c: Likewise.
2292         * specific.c: Likewise.
2293         * ptfork.c: Likewise.
2294
2295         * lockfile.c: Include internals.h to get prototypes.
2296         * events.c: Likewise.
2297         * sysdeps/alpha/pspinlock.c: Likewise.
2298         * sysdeps/arm/pspinlock.c: Likewise.
2299         * sysdeps/hppa/pspinlock.c: Likewise.
2300         * sysdeps/i386/pspinlock.c: Likewise.
2301         * sysdeps/ia64/pspinlock.c: Likewise.
2302         * sysdeps/m68k/pspinlock.c: Likewise.
2303         * sysdeps/mips/pspinlock.c: Likewise.
2304         * sysdeps/powerpc/pspinlock.c: Likewise.
2305         * sysdeps/s390/pspinlock.c: Likewise.
2306         * sysdeps/sh/pspinlock.c: Likewise.
2307         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
2308         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
2309         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
2310
2311 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
2312
2313         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
2314         (__pthread_attr_getstack): Return correct address.
2315         Add warnings for using pthread_attr_getstackaddr and
2316         pthread_attr_setstackaddr.
2317
2318 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
2319
2320         * Examples/ex6.c (test_thread): Make static.
2321         * Examples/ex12.c (test_thread): Make static and add noreturn
2322         attribute.
2323
2324 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
2325
2326         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
2327         and compare_and_swap_with_release_semantics returns int not long.
2328
2329 2000-12-17  Andreas Jaeger  <aj@suse.de>
2330
2331         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
2332         value.
2333         * sysdeps/arm/pt-machine.h (testandset): Likewise.
2334         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
2335         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
2336         * sysdeps/sh/pt-machine.h (testandset): Likewise.
2337         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
2338         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
2339
2340 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
2341
2342         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
2343         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
2344
2345 2000-12-17  Andreas Jaeger  <aj@suse.de>
2346
2347         * internals.h: Add prototypes for testandset and
2348         __compare_and_swap to shut up gcc warnings.
2349
2350 2000-12-06  Wolfram Gloger  <wg@malloc.de>
2351
2352         * join.c (pthread_detach): Allow case where the thread has already
2353         terminated.
2354
2355 2000-12-05  Andreas Jaeger  <aj@suse.de>
2356
2357         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
2358         * sysdeps/mips/pt-machine.h (testandset): Likewise.
2359         (__compare_and_swap): Likewise.
2360         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
2361
2362 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
2363
2364         * Examples/ex3.c (main): Cast int to long before casting to void *.
2365         (search): Cast void * to long, not int.
2366         * Examples/ex8.c (main, thread): Similarly.
2367         * Examples/ex11.c (main): Similarly.
2368         * Examples/ex14.c (worker, do_test): Similarly.
2369         * ecmutex.c (worker, do_test): Similarly.
2370         (nlocks): Cast to int.
2371
2372 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
2373
2374         * linuxthreads.texi:  Add documentation for pthreads attributes
2375         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
2376         patch.  Document pthread_[sg]etconcurrency().  Mark
2377         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
2378
2379 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
2380
2381         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
2382         Don't define it.
2383         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2384         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
2385
2386 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
2387
2388         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
2389         not doing it right now.
2390         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
2391
2392 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
2393
2394         * Examples/ex4.c (main): Don't use exit() to avoid warning with
2395         broken compilers.
2396
2397 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
2398
2399         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
2400         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
2401
2402         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
2403         discussing mutexes. (As per the Unix98 name for the API.)
2404         Changes documentation for pthread_mutexattr_setkind_np() and
2405         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
2406         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
2407         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
2408         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
2409         Begins to introduce discussion of the ``timed'' mutex type.  This
2410         discussion is currently incomplete.
2411         Patch by Bruce Mitchener <bruce@cubik.org>.
2412
2413 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
2414             Yutaka Niibe  <gniibe@chroot.org>
2415
2416         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
2417         has restrictions, use register.
2418
2419 2000-10-23  Andreas Schwab  <schwab@suse.de>
2420
2421         * Examples/ex14.c (TIMEOUT): Override default timeout.
2422
2423 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
2424
2425         * specific.c: Protect tsd array modification in thread data
2426         structures by getting the thread lock in pthread_key_delete and
2427         __pthread_destroy_specifics.
2428         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
2429
2430 2000-10-12  Alan Modra <alan@linuxcare.com.au>
2431
2432         * sysdeps/pthread/bits/initspin.h: New file.
2433         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
2434         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
2435         (__pthread_alt_init_lock): Likewise.
2436         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
2437
2438 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
2439
2440         * oldsemaphore.c (__old_sem_init): Release lock with
2441         LT_SPINLOCK_INIT, not zero.
2442         * spinlock.c (__pthread_unlock): Likewise.
2443         (__pthread_alt_lock): Likewise.
2444         (__pthread_alt_timedlock): Likewise.
2445         (__pthread_alt_unlock): Likewise.
2446         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
2447         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
2448         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
2449         LT_SPINLOCK_INIT do initialize spinlocks not 0.
2450
2451 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
2452
2453         * shlib-versions: Add version definitions for hppa-linux.
2454
2455 2000-10-12  Alan Modra <alan@linuxcare.com.au>
2456
2457         * sysdeps/hppa/pspinlock.c: New file.
2458         * sysdeps/hppa/pt-machine.h: New file.
2459         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
2460
2461 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
2462
2463         * mutex.c (__pthread_mutex_destroy): Correct test of
2464         busy mutex for mutexes using alternate fastlocks.
2465         Patch by dtc@cmucl.cons.org.
2466
2467 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
2468
2469         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
2470
2471 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
2472
2473         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
2474         test for owner first.
2475         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2476
2477         * cancel.c (pthread_cancel): Don't do anything if cancelation is
2478         disabled.
2479
2480 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
2481
2482         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
2483         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2484
2485         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
2486         _POSIX_MONOTONIC_CLOCK.
2487
2488         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
2489         and explain why.
2490
2491 2000-09-20  Andreas Jaeger  <aj@suse.de>
2492
2493         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
2494         "testrtsig.h" conditional.
2495
2496 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
2497
2498         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
2499         pthread_attr_setstack.
2500         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
2501         pthread_attr_setstack.
2502         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
2503
2504 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
2505
2506         * Examples/ex14.c: New file.
2507         * Makefile (tests): Add ex14.
2508
2509         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
2510         mutex.  Patch by dtc@cmucl.cons.org.
2511
2512         * ecmutex.c: New file.
2513         * Makefile (tests): Add ecmutex.
2514
2515 2000-09-04  H.J. Lu  <hjl@gnu.org>
2516
2517         * attr.c (__pthread_attr_setguardsize): Use page_roundup
2518         instead of roundup to round up to the page size.
2519
2520 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
2521
2522         * manager.c (pthread_exited): Correctly report event as TD_REAP
2523         instead of TD_DEATH.  Fix comments.
2524
2525 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
2526
2527         * spinlock.h (testandset): Add cast to avoid warning.
2528         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
2529
2530 2000-09-02  Andreas Jaeger  <aj@suse.de>
2531
2532         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
2533         prototype.
2534
2535 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
2536
2537         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
2538         Fix typo in last patch (_mode -> _flags).
2539
2540         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
2541         Provide definition which respects _IO_USER_LOCK flag.
2542
2543 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
2544
2545         * manager.c (pthread_allocate_stack): Clear descriptor only if not
2546         mmaped.
2547
2548 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
2549
2550         * Makefile: Add rules to build and run unload.
2551         * unload.c: New file.
2552
2553         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
2554
2555         * sysdeps/pthread/pthread.h
2556         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
2557         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
2558
2559 2000-08-24  Andreas Jaeger  <aj@suse.de>
2560
2561         * Examples/ex13.c: Include <string.h> for strerror prototype and
2562         <stdlib.h> for abort prototype.
2563         (pthr_cond_signal_mutex): Rewrite to silence GCC.
2564         (thread_start): Remove unused variable err.
2565         (main): Silence GCC warnings.
2566
2567 2000-08-22  Andreas Jaeger  <aj@suse.de>
2568
2569         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
2570
2571         * Makefile (tests): Add ex13.
2572
2573 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
2574
2575         * semaphore.h: Add restrict where required by AGd4.
2576         * sysdeps/pthread/pthread.h: Likewise.
2577         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
2578
2579 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
2580
2581         * Makefile (tests): Add ex12.  Add rule to build it.
2582         * Examples/ex12.c: New file.
2583
2584 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
2585
2586         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
2587         even though the implementation is not quite complete (but it reports
2588         it).  Define _POSIX_MESSAGE_PASSING to -1.
2589         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2590
2591 2000-08-12  Andreas Jaeger  <aj@suse.de>
2592
2593         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
2594         assembler.
2595         (__compare_and_swap): Likewise.
2596         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
2597
2598 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
2599
2600         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
2601         p_h_errnop correctly and not to NULL.
2602
2603 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
2604
2605         * Banner: Bump version number to 0.9.
2606
2607 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
2608
2609         * Makefile (tests): Add tststack.  Add rule to build the program.
2610         * tststack.c: New file.
2611
2612         * internals.h: Declare __pthread_max_stacksize.
2613         * pthread.c (__pthread_max_stacksize): New variable.
2614         (__pthread_initialize_manager): Determine __pthread_initialize_manager
2615         value.
2616         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
2617         (pthread_allocate_stack): Allow kernel to choose stack address if
2618         FLOATING_STACKS.  This also handles variable-sized stacks.
2619         Always allocate stack and guardpage together.  Use mprotect to
2620         change guardpage access.
2621         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
2622         ARCH_STACK_MAX_SIZE.
2623
2624         * attr.c (__pthread_attr_setstacksize): Also test value against
2625         upper limit.
2626
2627         * manager.c (__pthread_nonstandard_stacks): Define only if
2628         THREAD_SELF is not defined.
2629         (pthread_allocate_stack): Always initialize gardaddr to a correct
2630         value.
2631         (pthread_handle_create): Unmap thread with one call.
2632         (pthread_free): Remove test for initial thread before removing stack.
2633         Unmap stack with one call.
2634
2635         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
2636         1 to avoid removing the stack.
2637
2638 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
2639
2640         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
2641         load of spin lock to prime the cache before the atomic compare and
2642         exchange operation (cmpxchg4). This avoids the spinning on the
2643         cmpxchg4 instruction and reduces movement of the cache line back
2644         and forth between the processors (explanation by Asis K. Mallick
2645         from Intel). This basically makes the implementation operate the
2646         same as the Linux kernel implementation.
2647
2648         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
2649         * sysdeps/ia64/pspinlock.c: New file.
2650
2651 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
2652
2653         * pthread.c: Move definition of __pthread_set_own_extricate_if...
2654         * spinlock.h: ...here.  Remove locking.
2655         * internals.h: Remove __pthread_set_own_extricate_if prototype.
2656
2657         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
2658         (rwlock_rd_extricate_func): Don't determine self, let
2659         __pthread_lock do it.
2660         (rwlock_wr_extricate_func): Likewise.
2661         (rwlock_have_already): Optimize *pself handling a bit.
2662
2663         * mutex.c: Use __builtin_expect.
2664         * pthread.c: Likewise.
2665
2666 2000-08-02  Andreas Jaeger  <aj@suse.de>
2667
2668         * sysdeps/s390/pspinlock.c: New file.
2669         * sysdeps/s390/pt-machine.h: New file.
2670         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
2671
2672 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
2673
2674         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
2675         R3K.
2676         * sysdeps/mips/pt-machine.h (testandset): Likewise.
2677
2678 2000-07-26  Andreas Jaeger  <aj@suse.de>
2679
2680         * pthread.c: Initialize p_sem_avail.
2681
2682 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
2683
2684         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
2685         * semaphore.c: Handle spurious wakeups.
2686
2687         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
2688         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
2689
2690         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
2691         (__pthread_wait_for_restart): Likewise.
2692
2693         * condvar.c (pthread_cond_wait): Also check whether thread is
2694         cancelable before aborting loop.
2695         (pthread_cond_timedwait): Likewise.
2696
2697         * signals.c (pthread_sighandler): Remove special code to restrore
2698         %gs on x86.
2699         (pthread_sighandler_t): Likewise.
2700
2701 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
2702
2703         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
2704         * pthread.c: Include <resolv.h>.
2705         (_res): Undefine.  Add extern declaration.
2706
2707 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
2708
2709         * pthread.c (__pthread_initial_thread): Update initializer.
2710         (__pthread_manager_thread): Likewise.
2711         (pthread_initialize): Move setrlimit call to...
2712         (__pthread_initialize_manager): ...here.
2713         (__pthread_reset_main_thread): Reset also soft limit on stack size.
2714
2715         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
2716         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
2717
2718 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
2719
2720         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
2721         __compare_and_swap to define testandset.
2722         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
2723         Define IMPLEMENT_TAS_WITH_CAS.
2724
2725 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
2726
2727         * Makefile: Pass -z nodelete to linker for libpthread.so
2728         generation if it understand this option.
2729
2730 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
2731
2732         * manager.c (pthread_handle_create): Remove initialization of
2733         new_thread->p_res._sock.
2734
2735 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
2736
2737         Bugfixes to the variant of the code for machines with no compare
2738         and swap.
2739
2740         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
2741         node was not being properly enqueued, due to failing to update
2742         the lock->__status field.
2743
2744         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
2745         being set inappropriately, causing the suspend function to be called
2746         with a null self pointer and crash.
2747
2748 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
2749
2750         * spinlock.h (__pthread_alt_trylock): Fix code used if no
2751         compare&swap is available.
2752
2753         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
2754         compare_and_swap.
2755
2756         * pthread.c (pthread_initialize): Don't use sysconf to determine
2757         whether the machine has more than one processor.
2758
2759         * spinlock.c (__pthread_alt_timedlock): Add back one of the
2760         removed thread_self calls.
2761
2762 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
2763
2764         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
2765         __compare_and_swap to compare_and_swap in code which assumes
2766         compare swap is available.
2767
2768 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
2769
2770         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
2771         bug whereby thr field of waitnode structure would not be correctly
2772         set unless a null self pointer is passed to the functions.
2773         Eliminated redundant calls to thread_self().
2774
2775 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
2776
2777         * pthread.c (__pthread_initialize_manager): Lock
2778         __pthread_manager_thread.p_lock before calling clone.
2779
2780 2000-05-05  H.J. Lu  <hjl@gnu.org>
2781
2782         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
2783         have acquire semantics.
2784         (__compare_and_swap_with_release_semantics): New inline
2785         function.
2786         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
2787
2788 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
2789
2790         * manager.c: Fix the problem with signals at startup.
2791         Change the way that thread stacks are allocated on IA64.
2792         Clean up some of the guard page allocation stuff.
2793
2794 1999-12-19  H.J. Lu  <hjl@gnu.org>
2795
2796         * internals.h (page_roundup): New.
2797         * attr.c (__pthread_attr_setguardsize); Use page_roundup
2798         instead of roundup.
2799         * manager.c (pthread_allocate_stack): Make sure guardaddr is
2800         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
2801         is define.
2802
2803 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
2804
2805         * manager.c (pthread_allocate_stack): Unmap the stack top
2806         if failed to map the stack bottom.
2807         Fix the guard page.
2808         (pthread_free): Fix the guard page.
2809
2810         * pthread.c (pthread_initialize): Set rlimit correctly for
2811         NEED_SEPARATE_REGISTER_STACK.
2812
2813 1999-12-16  H.J. Lu  <hjl@gnu.org>
2814
2815         * pthread.c (__pthread_initialize_manager): Pass
2816         __pthread_manager_thread_bos instead of
2817         __pthread_manager_thread_tos to __clone2.
2818
2819 1999-12-16  H.J. Lu  <hjl@gnu.org>
2820
2821         * manager.c (pthread_allocate_stack): Correct the calculation
2822         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
2823         stack bottom.
2824
2825 1999-12-13  H.J. Lu  <hjl@gnu.org>
2826
2827         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
2828         bit after setting ar.ccv.
2829
2830 1999-12-12  H.J. Lu  <hjl@gnu.org>
2831
2832         * manager.c (pthread_allocate_stack): Make the starting
2833         address of the stack bottom page aligned. FIXME: it may
2834         need changes in other places.
2835         (pthread_handle_create): Likewise.
2836
2837 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
2838
2839         * manager.c (pthread_allocate_stack): Handle
2840         NEED_SEPARATE_REGISTER_STACK.
2841         (pthread_handle_create): Likewise.
2842         * pthread.c (__pthread_initialize_manager): Likewise.
2843
2844         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
2845
2846 1999-12-02  H.J. Lu  <hjl@gnu.org>
2847
2848         * sysdeps/ia64/pt-machine.h: New.
2849
2850 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
2851
2852         * wrapsyscall.c: Mark non-__ protected names as weak.
2853         PR libc/1466.
2854
2855 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
2856
2857         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
2858
2859 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
2860
2861         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
2862         Add tests also to new alternative spinlock implementation.
2863         * spinlock.h: Likewise.
2864         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2865
2866 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
2867
2868         * Version: Export __sigaction.
2869         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
2870         of __sigaction.
2871         * pthread.c: Use __libc_sigaction instead of __sigaction.
2872
2873         * condvar.c: Implement pthread_condattr_getpshared and
2874         pthread_condattr_setpshared.
2875         * mutex.c: Implement pthread_mutexattr_getpshared and
2876          pthread_mutexattr_setpshared.
2877         * Versions: Export new functions.
2878         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2879
2880         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
2881         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
2882         is not selected.
2883
2884 2000-07-04  Greg McGary  <greg@mcgary.org>
2885
2886         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
2887         pragmas.  Include bp-sym.h only if _LIBC.
2888
2889 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
2890
2891         * spinlock.c (__pthread_unlock): Properly place write barrier.
2892         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2893
2894 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
2895
2896         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
2897         faster on SMP systems.  No more emulation of compare&swap for adaptive
2898         spinlocks.
2899         * spinlock.h: Likewise.
2900         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
2901         Replace fast with adaptive mutex.
2902         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
2903         * condvar.c: Likewise.
2904         * pthread.c: Define and initialize __pthread_smp_kernel variable.
2905         * internals.h: Declare __pthread_smp_kernel.
2906         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
2907         _pthread_fastlock structure.
2908         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2909
2910         * pthread.c: Remove initialization to zero from global variables.
2911
2912 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
2913
2914         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
2915
2916 2000-06-28  Greg McGary  <greg@mcgary.org>
2917
2918         * weaks.c: Wrap BP_SYM () around weak extern declarations of
2919         pthread functions that have pointers in their return+arg signatures.
2920
2921 2000-06-27  Greg McGary  <greg@mcgary.org>
2922
2923         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
2924         extern declarations of pthread functions that have pointers in
2925         their return+arg signatures.
2926
2927 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
2928
2929         * Makefile (tests): Add ex11.  Add rules to build it.
2930         * Examples/ex11.c: New file.
2931         * rwlock.c: Fix complete braindamaged previous try to implement
2932         timedout functions.
2933
2934         * spinlock.c: Pretty print.
2935
2936 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
2937
2938         * Makefile (tests): Add ex10.  Add rules to build it.
2939         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
2940         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
2941         * condvar.c (pthread_cond_wait): Allow mutex of kind
2942         PTHREAD_MUTEX_TIMED_NP.
2943         (pthread_cond_timedwait_relative): Likewise.
2944         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
2945         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
2946         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2947         (__pthread_mutex_lock): Use __pthread_alt_lock for
2948         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2949         (__pthread_mutex_timedlock): New function.
2950         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
2951         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2952         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
2953         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
2954         * spinlock.c: Implement alternate fastlocks.
2955         * spinlock.h: Add prototypes.
2956         * Examples/ex10.c: New file.
2957         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2958         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2959
2960         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
2961         (__pthread_rwlock_timedrdlock): New function.
2962         (__pthread_rwlock_timedwrlock): New function.
2963         Use laternate fastlock function everywhere.
2964
2965 2000-06-21  Andreas Jaeger  <aj@suse.de>
2966
2967         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
2968         prototype.
2969
2970         * join.c: Include <stdlib.h> for exit prototype.
2971
2972 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
2973
2974         * sysdeps/i386/useldt.h: Include <stdlib.h>.
2975
2976         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
2977         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2978
2979         * Makefile (libpthread-routines): Add barrier.
2980         (tests): Add ex9.  Add rule to build ex9.
2981         * Versions: Export barrier functions.
2982         * barrier.c: New file.
2983         * Examples/ex9.c: New file.
2984         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
2985         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
2986         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2987
2988 2000-06-19  H.J. Lu  <hjl@gnu.org>
2989
2990         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
2991         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
2992         (compare_and_swap_with_release_semantics): New. Default to
2993         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
2994         is not defined.
2995
2996         * spinlock.c (__pthread_unlock): Call
2997         compare_and_swap_with_release_semantics () instead of
2998         compare_and_swap ().
2999
3000 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
3001
3002         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
3003         to errno directly.
3004         * sysdeps/pthread/timer_delete.c: Likewise.
3005         * sysdeps/pthread/timer_getoverr.c: Likewise.
3006         * sysdeps/pthread/timer_gettime.c: Likewise.
3007         * sysdeps/pthread/timer_settime.c: Likewise.
3008
3009 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
3010
3011         Timer nodes are now reference counted, and can be marked
3012         as deleted. This allows for the safe release of the global mutex
3013         in the middle without losing the timer being operated on.
3014
3015         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
3016         member is now an enum with three values, so that an intermediate
3017         state can be represented (deleted but not free for reuse yet).
3018         New refcount member added.
3019         * sysdeps/pthread/timer_routines.c: Likewise.
3020
3021         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
3022         timer_valid): New inline functions added.
3023
3024         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
3025         restructured, recursive deadlock bug fixed.
3026
3027         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
3028         timer_addref to ensure that timer won't be deleted while mutex is not
3029         held. Also uses timer_invalid to perform validation of timer handle.
3030         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
3031         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
3032
3033 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
3034
3035         * shlib-versions: Add entry for SH.
3036         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
3037
3038 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
3039
3040         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
3041         tightened up some critical regions and micro-optimized some list
3042         manipulation code.
3043
3044         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
3045         Returns int value now to indicate whether timer was queued at head.
3046         * sysdeps/pthread/posix-timer.h: Likewise.
3047         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
3048         new return value from __timer_thread_queue_timer to avoid waking
3049         up timer thread unnecessarily.
3050
3051         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
3052         inuse flag, because this requires mutex to be held.  Callers updated
3053         to do the check when they have the mutex.
3054         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
3055
3056         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
3057         regions: avoids making system calls while holding timer mutex, and
3058         a few computations were moved outside of the mutex as well.
3059         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
3060
3061         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
3062         to list_unlink_ip, meaning idempotent.  Pointer manipulation
3063         changed to get better better code out of gcc.
3064         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
3065         version of list_unlink added here.
3066         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
3067         function in all places: idempotent one for timers, non-idempotent
3068         one for thread nodes.
3069         * sysdeps/pthread/timer_settime: Likewise.
3070         * sysdeps/pthread/timer_routines.c: Likewise.
3071
3072 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
3073
3074         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
3075         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3076
3077         * sysdeps/pthread/Makefile: Remove tests definition.
3078
3079 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
3080             Yutaka Niibe  <gniibe@chroot.org>
3081
3082         * sysdeps/sh/pspinlock.c: New file.
3083         * sysdeps/sh/pt-machine.h: New file.
3084
3085 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
3086
3087         * Makefile (tests): Add joinrace.
3088
3089         * Examples/ex6.c: Test return value of pthread_join.
3090
3091 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
3092
3093         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
3094         (__pthread_spin_trylock): Implement.
3095         (__pthread_spin_unlock): Implement.
3096         (__pthread_spin_init): Implement.
3097         (__pthread_spin_destroy): Implement.
3098
3099 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
3100
3101         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
3102         really append the entry.
3103
3104 2000-06-10  Andreas Jaeger  <aj@suse.de>
3105
3106         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
3107
3108 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
3109
3110         * sysdeps/pthread/timer_create.c: Thread matching now done on
3111         clock type as well as thread attributes.
3112         There are individual global signal-delivering threads for
3113         different clock types.
3114         * sysdeps/pthread/posix-timer.h: Likewise.
3115         * sysdeps/pthread/timer_routines.c: Likewise.
3116
3117         * sysdeps/pthread/timer_routines.c: Thread allocation and
3118         deallocation function now remembers to put thread on active
3119         list and remove from active list.
3120         Thus now the feature of binding multiple timers
3121         to a single thread actually works.
3122
3123 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
3124
3125         * pthread.c (__pthread_create_2_1): Optimize a bit.
3126
3127         * internals.h (invalid_handle): Also test for p_terminated != 0.
3128         (nonexisting_handle): New function.  Same as old invalid_handle.
3129         * join.c (pthread_join): Use nonexisting_handle instead of
3130         invalid_handle to test for acceptable thread handle.
3131         * manager.c (pthread_handle_free): Likewise.
3132         * joinrace.c: New file.
3133         Reported by Permaine Cheung <pcheung@cygnus.com>.
3134
3135 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
3136
3137         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
3138         Correct handling of matching variable.
3139
3140         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
3141         avoid warnings.
3142
3143         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
3144         Be prepared for empty timer list.
3145
3146         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
3147         CPUTIME clock ID.  Add support for thread clocks.
3148
3149         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
3150         subtraction were switched.
3151
3152         * sysdeps/pthread/timer_routines.c (init_module): Use
3153         THREAD_MAXNODES threads.
3154
3155         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
3156         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
3157         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
3158         with sigqueueinfo is this system call is available.
3159
3160         * sysdeps/pthread/timer_create.c (timer_create): Allow
3161         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
3162
3163         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
3164         functionality.
3165         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
3166
3167 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
3168
3169         * sysdeps/pthread/posix-timer.h: New file.
3170         * sysdeps/pthread/timer_create.c: New file.
3171         * sysdeps/pthread/timer_delete.c: New file.
3172         * sysdeps/pthread/timer_getoverr.c: New file.
3173         * sysdeps/pthread/timer_gettime.c: New file.
3174         * sysdeps/pthread/timer_routines.c: New file.
3175         * sysdeps/pthread/timer_settime.c: New file.
3176         * sysdeps/pthread/tst-timer.c: New file.
3177
3178 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
3179
3180         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
3181         LINK_MAX definitions if necessary.
3182
3183 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
3184
3185         Added missing fork time handling of global libio lock.
3186
3187         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
3188         not just the individual stream locks. Rewritten to use new
3189         iterator interface provided by libio rather than accessing
3190         global variable.
3191
3192         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
3193         which lock and unlock the stream list using the new interface
3194         provied by libio.
3195         * internals.h: Likewise.
3196
3197         * ptfork.c (__fork): Now calls __flockfilelist before fork,
3198         and __funlockfilelist in the parent after the fork.
3199         Child still calls __fresetlockfiles as before.
3200
3201         * linuxthreads.texi: Now explains what happens to streams at
3202         fork time. Also whole new section on forking and thread added.
3203         Definition of pthread_atfork moved out of Miscellaneous Functions
3204         to this new section.
3205
3206 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
3207
3208         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
3209         Add missing register.
3210         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
3211
3212 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
3213
3214         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
3215         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
3216         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
3217
3218 2000-05-31  Andreas Jaeger  <aj@suse.de>
3219
3220         * sysdeps/mips/pspinlock.c: Implement spinlocks.
3221
3222 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
3223
3224         * spinlock.c (__pthread_lock): Remove ASSERT.
3225
3226         * Makefile (tests): Add ex8.
3227         * Examples/ex8.c: New file.
3228
3229 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
3230
3231         Bugfix: The pthread_atfork mechanism now takes care of its
3232         own internal mutex at fork time.
3233
3234         * ptfork.c (__fork): Revised so that the mutex is held across
3235         the fork operation and while the handlers are called, and so that
3236         the child resets the mutex.
3237
3238         * linuxthreads.texi: Updated pthread_atfork documentation to make
3239         it clear that fork and pthread_atfork can't be reentered from
3240         atfork handlers, that pthread_atfork and fork are mutually atomic,
3241         and that the handlers are inherited by the child process.
3242
3243 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
3244
3245         * Makefile (libpthread-routines): Add pspinlock.
3246         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
3247         Use struct _pthread_fastlock instead of pthread_spinlock_t.
3248         * condvar.c: Likewise.
3249         * internals.h: Likewise.
3250         * join.c: Likewise.
3251         * manager.c: Likewise.
3252         * mutex.c: Likewise.
3253         * pthread.c: Likewise.
3254         * rwlock.c: Likewise.
3255         * semaphore.c: Likewise.
3256         * signals.c: Likewise.
3257         * spinlock.h: Likewise.
3258         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
3259         * sysdeps/alpha/pspinlock.c: New file.
3260         * sysdeps/arm/pspinlock.c: New file.
3261         * sysdeps/i386/pspinlock.c: New file.
3262         * sysdeps/m68k/pspinlock.c: New file.
3263         * sysdeps/mips/pspinlock.c: New file.
3264         * sysdeps/powerpc/pspinlock.c: New file.
3265         * sysdeps/sparc/sparc32/pspinlock.c: New file.
3266         * sysdeps/sparc/sparc64/pspinlock.c: New file.
3267         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
3268         back to _pthread_fastlock.  Define new pthread_spinlock_t.
3269
3270 2000-05-24  Andreas Jaeger  <aj@suse.de>
3271
3272         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
3273
3274 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
3275
3276         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
3277
3278 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
3279
3280         * internals.h (__RES_PTHREAD_INTERNAL): Define.
3281
3282 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
3283
3284         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
3285         object state is represented with additional bits which distinguish
3286         whether that state was set up in the current process, or
3287         in an ancestor process. If that state was set in an ancestor,
3288         it means that a fork happened while thread was executing the init
3289         function. In that case, the state is reset to NEVER.
3290         * mutex.c (__pthread_once_fork_prepare): New function.
3291         (__pthread_once_fork_child): Likewise
3292         (__pthread_once_fork_parent): Likewise
3293         (__pthread_reset_pthread_once): Removed.
3294         * ptfork.c (__fork): Call new handlers in mutex.c.
3295         * internals.h: Declarations of new mutex.c functions added.
3296         Declaration of removed function deleted.
3297         * linuxthreads.texi: Updated documentation about pthread_once
3298         to clarify what happens under cancellation and forking.
3299
3300 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
3301
3302         * internals.h: New thread manager request type, REQ_KICK.
3303         * join.c (pthread_exit): main thread now calls exit() instead
3304         of _exit() in order to proper process cleanup.
3305         * manager.c (__pthread_manager): Do not terminate manager
3306         after unblocking main thread; wait for main thread's
3307         REQ_PROCESS_EXIT request instead.
3308         Also, added REQ_KICK case to handle new request; this just does
3309         nothing.
3310         * manager.c (pthread_exited): Do not terminate manager after
3311         unblocking main thread.
3312         * manager.c (__pthread_manager_sighandler): If the main thread
3313         is waiting for all other threads to die, send a REQ_KICK into
3314         the thread manager request pipe to get it to clean out the threads
3315         and unblock the main thread as soon as possible. This fixes
3316         the 2000 millisecond hang on shutdown bug.
3317         * Examples/ex7.c: New file, tests shutdown behavior when all threads
3318         including the main one call pthread_exit(), or implicitly do so.
3319         * Makefile (tests): Add ex7.
3320
3321 2000-05-05  Andreas Jaeger  <aj@suse.de>
3322
3323         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
3324         (pthread_getcpuclockid): Correct test for ourselves.
3325
3326 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
3327
3328         * internals.h (struct _pthread_descr_struct): Reorganization.
3329         Allocate room for 16 pointers at head of the structure for future
3330         thread-local data handling.  Move p_self member in this area.
3331         * manager.c (pthread_handle_create): Adjust use of p_self.
3332         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
3333         * pthread.c (__pthread_initial_thread): Adjust initialization.
3334         (__pthread_manager_thread): Likewise.
3335
3336 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
3337
3338         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
3339         for eventmask larger than 1 word.
3340
3341 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
3342
3343         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
3344         * pthread.c (__pthread_initialize_minimal): New function.  Perform
3345         minimal initialization.
3346         (pthread_initialize): Remove this code here.
3347         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
3348         are working around the problem in glibc.
3349
3350 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
3351
3352         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
3353         now.  First gcc must be fixed (more concrete: libgcc).
3354
3355 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
3356
3357         * pthread.c: Remove special treatement for interrupt handlers on x86.
3358         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
3359         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
3360         necessary.
3361         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
3362
3363 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
3364
3365         * join.c (pthread_exit): Set p_terminated after reporting the
3366         termination event instead of before.
3367
3368 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
3369
3370         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
3371         if __USE_UNIX98.
3372
3373 2000-04-18  Andreas Jaeger  <aj@suse.de>
3374
3375         * Versions: Use ld instead of ld.so.
3376
3377 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
3378
3379         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
3380         Remove the typedef keyword.
3381
3382 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
3383
3384         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
3385         not stbar.
3386         (READ_MEMORY_BARRIER): Define.
3387         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
3388         MEMORY_BARRIER.
3389         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
3390         headers.
3391
3392 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
3393
3394         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
3395         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
3396         use thread_handle().
3397
3398 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
3399
3400         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
3401         if fast mutex is used.  Don't initialize `already_canceled' twice.
3402         Correctly test for return value of timedsuspend.
3403
3404         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
3405         therefore don't need the _rt versions of the signal handlers.
3406
3407 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
3408
3409         * pthread.c (pthread_yield): New function.
3410         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
3411         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
3412         * internals.h: Declare __pthread_yield.
3413
3414         * pthread.c (pthread_initialize): Avoid a bit more code if
3415         realtime signals are known to exist.
3416
3417         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
3418         to dynamically detect RT signals and avoid generating compatibility
3419         functions with old kernel.
3420         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
3421         __pthread_restart_new directly.
3422         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
3423         __pthread_wait_for_restart_signal directly.
3424         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
3425         __pthread_timedsuspend_new directly.
3426
3427 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
3428
3429         * condvar.c: Remove all the special code to handle cond_timedwait.
3430         Use timedsuspend instead.
3431         * internals.h: Declare __pthread_timedsuspend_old,
3432         __pthread_timedsuspend_new, and __pthread_timedsuspend.
3433         Remove declaration of __pthread_init_condvar.
3434         * pthread.c: Define __pthread_timedsuspend variable.
3435         (__pthread_timedsuspend_old): New function.  Timed suspension
3436         implementation for old Linux kernels.
3437         (__pthread_timedsuspend_new): New function.  Timed suspension
3438         implementation for new Linux kernels.
3439         * restart.h (timedsuspend): New function.  Call appropriate
3440         suspension function through __pthread_timedsuspend.
3441         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
3442         the code.
3443         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
3444
3445         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
3446         undefined.
3447         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
3448         where possible.
3449         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
3450         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3451
3452         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
3453         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3454
3455 2000-04-14  Andreas Jaeger  <aj@suse.de>
3456
3457         * weaks.c: Fix typo.
3458
3459         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
3460         2.2 for linuxthreads.
3461
3462 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
3463
3464         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
3465         (pthread_getcpuclockid): Fix typo.
3466
3467 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
3468
3469         * Makefile (libpthread-routines): Add getcpuclockid.
3470         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
3471         * sysdeps/pthread/getcpuclockid.c: New file.
3472         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
3473         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
3474
3475         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
3476         Defined.
3477         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3478
3479         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
3480         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
3481         and pthread_spin_unlock.
3482         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
3483         into pthread_spinlock_t.  Change all uses.
3484         * spinlock.c: Implement pthread_spin_lock.
3485         Rename __pthread_unlock to __pthread_spin_unlock and define weak
3486         alias for real name.
3487         Define pthread_spin_trylock, pthread_spin_init, and
3488         pthread_spin_destroy.
3489         Change all uses of _pthread_fastlock to pthread_spinlock_t.
3490         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
3491         Change all uses of _pthread_fastlock to pthread_spinlock_t.
3492         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
3493         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
3494         and pthread_spin_unlock.
3495         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
3496         Change all uses of _pthread_fastlock to pthread_spinlock_t.
3497         * condvar.c: Likewise.
3498         * internals.h: Likewise.
3499         * join.c: Likewise.
3500         * manager.c: Likewise.
3501         * mutex.c: Likewise.
3502         * pthread.c: Likewise.
3503         * rwlock.c: Likewise.
3504         * semaphore.c: Likewise.
3505         * signals.c: Likewise.
3506
3507         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
3508         macros.
3509         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
3510
3511 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
3512
3513         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
3514         _POSIX_SHARED_MEMORY_OBJECTS.
3515
3516 2000-04-11  Andreas Jaeger  <aj@suse.de>
3517
3518         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
3519         (__compare_and_swap): Mark as modifying memory.
3520
3521 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
3522
3523         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
3524         __volatile__.
3525         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
3526         Don't have the 'asm' __volatile__.
3527
3528 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
3529
3530         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
3531         * spinlock.c (__pthread_lock): Add memory barriers.
3532         (__pthread_unlock): Likewise.
3533         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
3534         instruction.
3535         (RELEASE): Not needed anymore.
3536         (__compare_and_swap): Mark asm as modifying memory.
3537         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
3538         of MEMORY_BARRIER.
3539         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
3540         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
3541         (MEMORY_BARRIER): Define using stbar.
3542         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
3543         stbar.
3544         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
3545         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
3546         Mike Burrows <m3b@pa.dec.com>.
3547
3548 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
3549
3550         * signals.c (sigaction): Fix return value for the case SIG is one
3551         of the signals the implementation uses.
3552         Patch by Xavier.Leroy@inria.fr.
3553
3554 2000-04-01  Andreas Jaeger  <aj@suse.de>
3555
3556         * attr.c: Use shlib-compat macros.
3557         * oldsemaphore.c: Likewise.
3558         * pthread.c: Likewise.
3559         * weaks.c: Likewise.
3560
3561 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
3562
3563         * semaphore.c (sem_timedwait): New function.
3564         Patch by Carl Mailloux <carlm@oricom.ca>.
3565         * semaphore.h: Declare sem_timedwait.
3566         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
3567
3568 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
3569
3570         * sysdeps/pthread/Makefile: File removed.
3571
3572 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
3573
3574         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
3575         * internals.h (__pthread_reset_pthread_once): Add prototype.
3576         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
3577
3578         * manager.c (pthread_handle_create): Store ID of new thread before
3579         clone call.
3580
3581 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
3582
3583         * attr.c: Use new macros from shlib-compat.h to define versions.
3584         * oldsemaphore.c: Likewise.
3585         * semaphore.c: Likewise.
3586         * weaks.c: Likewise.
3587
3588         * pthread.c: Update for new SHLIB_COMPAT definition.
3589
3590         * manager.c (__pthread_manager): Unmask debug signal.
3591
3592         * pthread.c (pthread_initialize): Test for address of __dso_handle
3593         being NULL, not value.  Use __on_exit, not on_exit.
3594         Patch by Andreas Jaeger <aj@suse.de>.
3595
3596         * pthread.c: Use new macros from shlib-compat.h to define versions.
3597
3598 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
3599
3600         * pthread.c (pthread_initialize): Instead of on_exit use
3601         __cxa_atexit if __dso_label is available to allow unloading the
3602         libpthread shared library.
3603
3604 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
3605
3606         * condvar.c: Make tests for ownership of mutex less strict.
3607
3608 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
3609
3610         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
3611         current thread and return error if not.
3612         (pthread_cond_timedwait_relative_old): Likewise.
3613         (pthread_cond_timedwait_relative_new): Likewise.
3614
3615         * mutex.c (__pthread_once): Handle cancelled init function correctly.
3616         (pthread_once_cancelhandler): New function.
3617         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
3618
3619 2000-03-14  Andreas Jaeger  <aj@suse.de>
3620
3621         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
3622         REG_GS.
3623         (pthread_handle_sigrestart_rt): Likewise.
3624         * signals.c (pthread_sighandler_rt): Likewise.
3625
3626 2000-03-02  Andreas Jaeger  <aj@suse.de>
3627
3628         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
3629         Reported by Sean Chen <sean.chen@turbolinux.com>.
3630
3631 2000-02-28  Andreas Jaeger  <aj@suse.de>
3632
3633         * rwlock.c: Fix typo.
3634
3635 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
3636
3637         * rwlock.c: Define __* variants of the functions and make old names
3638         aliases.
3639         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
3640         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
3641
3642 2000-02-25  Andreas Jaeger  <aj@suse.de>
3643
3644         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
3645         pwrite64, lseek64, open64, and __open64 with version 2.2.
3646
3647 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
3648
3649         * semaphore.h (SEM_FAILED): Use 0 not NULL.
3650
3651 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
3652
3653         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
3654         nanosleep does not work either.  Get absolute time inside the
3655         loop.
3656         (pthread_cond_timedwait_relative_new): Likewise.
3657         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
3658
3659 2000-02-13  Andreas Jaeger  <aj@suse.de>
3660
3661         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
3662         (pthread_cond_timedwait_relative_old): Likewise.
3663
3664 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
3665
3666         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
3667         but keep the code around.  A bug in the kernel prevent us from
3668         using the code.
3669         (pthread_cond_timedwait_relative_new): Likewise.
3670         (PR libc/1597 and libc/1598).
3671
3672 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
3673
3674         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
3675         loop around nanosleep calls instead of around most of the function
3676         (pthread_cond_timedwait_relative_new): Likewise.
3677         body.  Got rid of backwards goto and one local.
3678
3679 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
3680
3681         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
3682         before every nanosleep call to account for time spent in the rest
3683         of the function.
3684         (pthread_cond_timedwait_relative_new): Likewise.
3685         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
3686
3687 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
3688
3689         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
3690         from nanosleep call so that in case we restart we only wait for the
3691         remaining time.
3692         (pthread_cond_timedwait_relative_new): Likewise.
3693         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
3694
3695 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
3696
3697         * manager.c (pthread_allocate_stack): Compute guard page address
3698         correctly.  Patch by HJ Lu.
3699
3700         * sysdeps/pthread/pthread.h: Define
3701         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
3702
3703 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
3704
3705         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
3706         preference handling.
3707         (pthread_rwlockattr_setkind_np): Allow
3708         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
3709         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
3710
3711 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
3712
3713         * internals.h (pthread_readlock_info): New structure.
3714         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
3715         p_untracked_readlock_count.
3716         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
3717         Add initializers for new fields.
3718         * manager.c (pthread_free): Free read/write lock lists.
3719         * queue.h (queue_is_empty): New function.
3720         * rwlock.c: Implement requirements about when readers should get
3721         locks assigned.
3722         * sysdeps/pthread/pthread.h
3723         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
3724         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
3725         Define this name as well.
3726         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
3727
3728 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
3729
3730         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
3731         Adjust initializers for struct _pthread_descr_struct change.
3732         * internals.h (struct _pthread_descr_struct): Move new elements to
3733         the end.
3734
3735 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
3736
3737         Redesigned how cancellation unblocks a thread from internal
3738         cancellation points (sem_wait, pthread_join,
3739         pthread_cond_{wait,timedwait}).
3740         Cancellation won't eat a signal in any of these functions
3741         (*required* by POSIX and Single Unix Spec!).
3742         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
3743         simultaneous condition variable signal (not required by POSIX
3744         or Single Unix Spec, but nice).
3745         * spinlock.c: __pthread_lock queues back any received restarts
3746         that don't belong to it instead of assuming ownership of lock
3747         upon any restart; fastlock can no longer be acquired by two threads
3748         simultaneously.
3749         * restart.h: Restarts queue even on kernels that don't have
3750         queued real time signals (2.0, early 2.1), thanks to atomic counter,
3751         avoiding a rare race condition in pthread_cond_timedwait.
3752
3753 1999-12-31  Andreas Jaeger  <aj@suse.de>
3754
3755         * internals.h: Remove duplicate prototype declarations.
3756
3757         * weaks.c: Remove __THROW from prototypes since the file is not
3758         compiled by a C++ compiler.
3759         * internals.h: Likewise.
3760
3761 1999-12-30  Andreas Jaeger  <aj@suse.de>
3762
3763         * sysdeps/pthread/pthread.h: Move internal functions to...
3764         * sysdeps/pthread/bits/libc-lock.h: ...here.
3765
3766 1999-12-29  Andreas Jaeger  <aj@suse.de>
3767
3768         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
3769
3770 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
3771
3772         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
3773         beginning.
3774
3775         * manager.c (__pthread_start): Add one more cast to prevent
3776         warning on 64bit machines.
3777
3778 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
3779
3780         * manager.c (pthread_handle_create): Set p_pid of new thread
3781         before calling the callback function to report a new thread.
3782
3783 1999-12-20  Andreas Jaeger  <aj@suse.de>
3784
3785         * pthread.c (pthread_initialize): Move getrlimit call after
3786         setting of errno.
3787
3788 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
3789
3790         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
3791         pwrite64, lseek64, open64, and __open64.
3792         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
3793         pwrite64, lseek64, open64, and __open64.
3794
3795         * manager.c (pthread_allocate_stack): Correct computation of
3796         new_thread_bottom.  Correct handling of stack size and when the
3797         rlimit method to guard for stack growth is used.
3798         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
3799         minus one pagesize (not two).
3800
3801 1999-12-03  Andreas Jaeger  <aj@suse.de>
3802
3803         * Versions: Add __res_state with version GLIBC_2.2.
3804
3805         * errno.c (__res_state): New function to return thread specific
3806         resolver state.
3807
3808         * pthread.c (pthread_initialize): Initialize p_resp.
3809         (__pthread_reset_main_thread): Also set p_resp.
3810
3811         * manager.c (pthread_handle_create): Initialize p_resp.
3812
3813         * internals.h: Add thread specific resolver state.
3814         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
3815
3816 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
3817
3818         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
3819         beginning.
3820         * sysdeps/i386/i686/pt-machine.h: Likewise.
3821         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
3822
3823 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
3824
3825         * manager.c (pthread_start_thread_event): Initialize p_pid already
3826         here.
3827
3828 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
3829
3830         * internals.h: Add prototype for __pthread_manager_event.
3831         * manager.c (__pthread_manager_event): New function.
3832         (pthread_start_thread_event): Correct computation of self.
3833         Use INIT_THREAD_SELF.
3834         * pthread.c (__pthread_manager_thread): Initialize p_lock.
3835         (__pthread_initialize_manager): Respect event flags also for creation
3836         of the manager thread.
3837
3838 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
3839
3840         * pthread.c (__pthread_initialize_manager): Initialize
3841         __pthread_manager_thread.p_tid.
3842
3843 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
3844
3845         * internals.h: Declare __pthread_last_event.
3846         * manager.c: Define __pthread_last_event.
3847         (pthread_handle_create): Set __pthread_last_event.
3848         (pthread_exited): Likewise.
3849         * join.c (pthread_exit): Likewise.
3850
3851         * Makefile (libpthread-routines): Add events.
3852         * events.c: New file.
3853         * internals.h: Protect against multiple inclusion.
3854         Include thread_dbP.h header.
3855         (struct _pthread_descr_struct): Add new fields p_report_events and
3856         p_eventbuf.
3857         Declare event reporting functions.
3858         * join.c (pthread_exit): Signal event if this is wanted.
3859         * manager.c (__pthread_threads_events): New variable.
3860         (pthread_handle_create): Take new parameters with event information.
3861         Signal TD_CREATE event if wanted.
3862         (__pthread_manager): Adjust pthread_handle_create call.
3863         (pthread_start_thread_event): New function.  Block until manager is
3864         finished and then call pthread_start_thread.
3865         (pthread_exited): Signal TD_REAP event if wanted.
3866
3867 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
3868
3869         * restart.h (suspend_with_cancellation): Rewrite as a macro.
3870
3871         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
3872
3873 1999-10-25  Andreas Jaeger  <aj@suse.de>
3874
3875         * internals.h: Remove K&R compatibility.
3876         * no-tsd.c: Likewise.
3877         * semaphore.h: Likewise.
3878         * signals.c: Likewise.
3879         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
3880         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
3881         * weaks.c: Likewise.
3882
3883 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
3884
3885         * pthread.c: For i386, wrap pthread_handle_sigrestart and
3886         pthread_handle_sigcancel with functions that restore %gs from the
3887         signal context.  For each signal handling function, two wrappers
3888         are required, one for a non-RT signal and one for a RT signal.
3889         * signal.c: For i386, add code to restore %gs from the signal
3890         context in pthread_sighandler and pthread_sighandler_rt.
3891
3892 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
3893
3894         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
3895
3896 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
3897
3898         * pthread.c (__pthread_initial_thread): Pass argument to
3899         PTHREAD_START_ARGS_INITIALIZER.
3900         (__pthread_manager_thread): Likewise.
3901
3902         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
3903         initialize function.
3904
3905         * manager.c (pthread_handle_create): Remove p_startfct initialization.
3906
3907         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
3908
3909 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
3910
3911         * internals.h: Correct return types for __libc_read and __libc_write.
3912
3913 1999-10-09  Andreas Jaeger  <aj@suse.de>
3914
3915         * internals.h: Add __new_sem_post to get prototype in
3916         manager.c; include semaphore.h for needed types.
3917
3918 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
3919
3920         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
3921         directly instead of calling sem_post which should not be necessary
3922         but is faster and might help in some case to work around problems.
3923         Patch by khendricks@ivey.uwo.ca [libc/1382].
3924
3925 1999-10-08  Andreas Schwab  <schwab@suse.de>
3926
3927         * sysdeps/pthread/Subdirs: New file.
3928         * Implies: Removed.
3929
3930 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
3931
3932         * Implies: New file.
3933         * internals.h (struct _pthread_descr_struct): Add p_startfct.
3934         * manager.c (pthread_handle_create): Initialize p_startfct.
3935         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
3936
3937 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
3938
3939         * manager.c (__linuxthreads_pthread_threads_max): New variable.
3940         * specific.c (__linuxthreads_pthread_keys_max): New variable.
3941         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
3942
3943         * condvar.c (pthread_cond_timedwait_relative): Never return with
3944         EINTR.  Patch by Andreas Schwab.
3945
3946 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
3947
3948         * signals.c (sigaction): Correct last patch.  Don't select
3949         pthread_sighandler_rt based on the signal number but instead of
3950         the SA_SIGINFO flag.
3951
3952 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
3953
3954         * specific.c: Move definitions of struct pthread_key_struct and
3955         destr_function to ...
3956         * internals.h: ...here.
3957
3958 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
3959
3960         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
3961         this instead of pthread_handle_sigrestart if the signal is an RT
3962         signal.
3963
3964         * signals.c: Handle passing through of sighandler arguments also
3965         for real-time signals.
3966
3967 1999-09-03  Andreas Schwab  <schwab@suse.de>
3968
3969         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
3970         fork as weak alias.
3971         (__vfork): New function, alias vfork.
3972         * Versions: Export __fork, vfork, and __vfork in libpthread.
3973
3974 1999-08-23  Andreas Schwab  <schwab@suse.de>
3975
3976         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
3977         call to signal handler.
3978
3979 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
3980
3981         * pthread.c (__pthread_reset_main_thread): Undo last change.
3982         (__pthread_kill_other_threads_np): Reset signal handlers for the
3983         signals we used in the thread implementation here.
3984
3985 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
3986
3987         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
3988         for the signals we used in the thread implementation [PR libc/1234].
3989
3990         * Versions: Export __pthread_kill_other_threads_np from libpthread
3991         for GLIBC_2.1.2.
3992
3993         * signals.c: Pass sigcontext through wrapper to the user function.
3994
3995 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
3996
3997         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
3998         __libc_internal_tsd_set.
3999
4000 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
4001
4002         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
4003         needed anymore.
4004
4005 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
4006
4007         * internals.h: Align _pthread_descr_struct to 32 bytes.
4008         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
4009         libc/1206.