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