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