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