(sysdep_routines, shared-only-routines): Don't add divdi3 here.
[glibc.git] / linuxthreads / ChangeLog
blob084ed375c2c67f4d605946522377d996b125bf9c
1 2002-09-18  Bruno Haible  <bruno@clisp.org>
3         * Examples/ex10.c (thread): Fail if pthread_mutex_timedlock() returns
4         an unexpected error code.
6         * internals.h (__pthread_message): Add const to first parameter type.
7         * pthread.c (__pthread_message): Likewise.
9         * sysdeps/unix/sysv/linux/configure: Moved to ../sysdeps/pthread.
11 2002-09-17  Roland McGrath  <roland@redhat.com>
13         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT, TLS_DO_SET_THREAD_AREA):
14         Set the descriptor limit to the full 4GB, so %gs:OFFSET works for any
15         offset (positive or negative) relative to the thread struct.
16         * sysdeps/i386/useldt.h (DO_MODIFY_LDT, DO_SET_THREAD_AREA): Likewise.
18 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
20         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Move...
21         * sysdeps/unix/sysv/linux/sparc/Makefile: ...here.
22         Replace /usr/lib/crt[in].o with crt[in].o too.
24 2002-09-11  Steven Munroe  <sjmunroe@us.ibm.com>
26         * sysdeps/powerpc/powerpc64/pt-machine.h: New file.
28 2002-09-04  Bruno Haible  <bruno@clisp.org>
30         * pthread.c: Include <sys/time.h>.
31         (is_smp_system): Move to sysdeps/unix/sysv/linux/smp.h.
32         * sysdeps/unix/sysv/linux/smp.h: New file, extracted from pthread.c.
33         * Makefile (distribute): Add smp.h to the list.
35 2002-09-04  Bruno Haible  <bruno@clisp.org>
37         * sysdeps/alpha/pt-machine.h: Choose different include file location
38         on non-Linux platforms.
40         * wrapsyscall.c (PROMOTE_INTEGRAL_TYPE): New macro.
41         (open, open64): Change va_arg argument type to the integral type to
42         which mode_t promotes.
44         * sysdeps/pthread/tst-timer.c (main): Don't assume anything about
45         the structure of 'struct sigevent'.
47         * errno.c (__errno_location, __h_errno_location, __res_state):
48         Use prototype function definitions.
50 2002-07-29  Steven Munroe  <sjmunroe@us.ibm.com>
52         * shlib-versions: Set libpthread version to 2.3 for powerpc64.
53         * sysdeps/powerpc/pt-machine.h: moved to...
54         * sysdeps/powerpc/powerpc32/pt-machine.h: ...here
55         * sysdeps/powerpc/powerpc64/pt-machine.h: New file.
57 2002-09-02  Roland McGrath  <roland@redhat.com>
59         * sysdeps/powerpc/Makefile (CFLAGS-pt-initfini.s): New variable.
61 2002-09-01  Roland McGrath  <roland@redhat.com>
63         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t): Add new keys
64         CTYPE_B, CTYPE_TOLOWER, CTYPE_TOUPPER.
66         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_address): New macro.
67         (__libc_internal_tsd_address): Declare it.
68         * Versions (libc, ld, libpthread: GLIBC_PRIVATE): Add
69         __libc_internal_tsd_address.
70         * specific.c (libc_internal_tsd_address): New function.
71         (__libc_internal_tsd_address): New variable.
72         * no-tsd.c (__libc_internal_tsd_address): New variable.
74 2002-08-31  Ulrich Drepper  <drepper@redhat.com>
76         * Makefile: Don't use rule for crt%.o, spell it out as rules for
77         crti.o and crtn.o.
79 2002-08-30  Roland McGrath  <roland@redhat.com>
81         * Makefile (extra-objs, omit-deps): Add crtn.
82         ($(objpfx)libpthread.so): Depend on $(objpfx)crtn.o.
83         ($(objpfx)libpthread.so: +postinit): Append $(objpfx)crtn.o.
84         ($(objpfx)crtn.S): New target.
85         ($(objpfx)crt%.o): Pattern rule replaces crti.o target.
86         (generated): Add crtn.S.
88         * sysdeps/unix/sysv/linux/x86_64/Makefile ($(objpfx)specs): Massage
89         crtn.o pathname too.
91 2002-08-30  Jakub Jelinek  <jakub@redhat.com>
93         * pthread.c (__pthread_initialize_minimal): Call __uselocale even
94         if [! SHARED].
96 2002-08-30  Roland McGrath  <roland@redhat.com>
98         * tst-static-locale.c: New file.
99         * Makefile (tests, tests-static): Add it.
101 2002-04-24  Steven Munroe  <sjmunroe@us.ibm.com>
103         * spinlock.c (__pthread_lock): Fix spurious wakeup
104         handling.  Don't clear lowest bit of list pointer as sign the thread
105         is still on the wait list.  Don't restart after spurious wakeup
106         with spinning to get the lock.
107         (__pthread_unlock): Take set lowest bit into account when handling
108         pointer to list elements.
109         Patch by Steve Munroe <sjmunroe@us.ibm.com>.
111 2002-08-28  Roland McGrath  <roland@redhat.com>
113         * sysdeps/pthread/timer_routines.c (thread_func): Fix type in cast.
115 2002-08-28  Jakub Jelinek  <jakub@redhat.com>
117         * sysdeps/unix/sysv/linux/hppa/aio_cancel.c: New file.
118         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
119         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
121 2002-08-28  Ulrich Drepper  <drepper@redhat.com>
123         * sysdeps/pthread/timer_routines.c (thread_func): Change return
124         type to void and add casts in use to avoid warnings with all gcc
125         versions.
127 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
129         * sysdeps/unix/sysv/linux/bits/local_lim.h (PTHREAD_THREADS_MAX):
130         Bump to 16384.
131         * manager.c (__pthread_handles): Remove.
132         * pthandles.c: New file.
133         * pthread.c (__pthread_initialize_minimal): Initialize
134         __pthread_handles[0] and __pthread_handles[1].
135         * Makefile (libpthread-routines): Add pthandles (must be last).
137 2002-08-26  Brian Youmans  <3diff@gnu.org>
139         * Examples/ex10.c: Corrected version number in Lesser GPL copying
140         permission notice from 2 to 2.1.
141         * Examples/ex11.c: Likewise.
142         * Examples/ex13.c: Likewise.
143         * Examples/ex8.c: Likewise.
144         * Examples/ex9.c: Likewise.
145         * barrier.c: Likewise.
146         * events.c: Likewise.
147         * lockfile.c: Likewise.
148         * no-tsd.c: Likewise.
149         * pt-machine.c: Likewise.
150         * ptclock_gettime.c: Likewise.
151         * ptclock_settime.c: Likewise.
152         * rwlock.c: Likewise.
153         * sysdeps/alpha/pspinlock.c: Likewise.
154         * sysdeps/alpha/pt-machine.h: Likewise.
155         * sysdeps/arm/pspinlock.c: Likewise.
156         * sysdeps/arm/pt-machine.h: Likewise.
157         * sysdeps/cris/pspinlock.c: Likewise.
158         * sysdeps/cris/pt-machine.h: Likewise.
159         * sysdeps/hppa/pspinlock.c: Likewise.
160         * sysdeps/hppa/pt-machine.h: Likewise.
161         * sysdeps/i386/i686/pt-machine.h: Likewise.
162         * sysdeps/i386/pspinlock.c: Likewise.
163         * sysdeps/i386/pt-machine.h: Likewise.
164         * sysdeps/i386/useldt.h: Likewise.
165         * sysdeps/ia64/pspinlock.c: Likewise.
166         * sysdeps/ia64/pt-machine.h: Likewise.
167         * sysdeps/m68k/pspinlock.c: Likewise.
168         * sysdeps/m68k/pt-machine.h: Likewise.
169         * sysdeps/mips/pspinlock.c: Likewise.
170         * sysdeps/mips/pt-machine.h: Likewise.
171         * sysdeps/powerpc/pspinlock.c: Likewise.
172         * sysdeps/powerpc/pt-machine.h: Likewise.
173         * sysdeps/pthread/bits/initspin.h: Likewise.
174         * sysdeps/pthread/bits/libc-lock.h: Likewise.
175         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
176         * sysdeps/pthread/getcpuclockid.c: Likewise.
177         * sysdeps/pthread/posix-timer.h: Likewise.
178         * sysdeps/pthread/timer_create.c: Likewise.
179         * sysdeps/pthread/timer_delete.c: Likewise.
180         * sysdeps/pthread/timer_getoverr.c: Likewise.
181         * sysdeps/pthread/timer_gettime.c: Likewise.
182         * sysdeps/pthread/timer_routines.c: Likewise.
183         * sysdeps/pthread/timer_settime.c: Likewise.
184         * sysdeps/pthread/tst-timer.c: Likewise.
185         * sysdeps/s390/pspinlock.c: Likewise.
186         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
187         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
188         * sysdeps/sh/pspinlock.c: Likewise.
189         * sysdeps/sh/pt-machine.h: Likewise.
190         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
191         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
192         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
193         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
194         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
195         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
196         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
197         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
198         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
199         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
200         * tststack.c: Likewise.
201         * unload.c: Likewise.
202         * weaks.c: Likewise.
203         * wrapsyscall.c: Likewise.
205         * sysdeps/pthread/pt-initfini.c: Changed copying
206         permission notice to Lesser GPL from Library GPL, including the
207         references in the special exception.
208         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: Likewise.
209         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Likewise.
210         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c:
211         Likewise.
212         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c:
213         Likewise.
214         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Likewise.
216 2002-08-26  Ulrich Drepper  <drepper@redhat.com>
218         * Examples/ex10.c (thread): tv_nsec == 1000000000 is already
219         overflow [PR libc/4244].
221 2002-08-25  Ulrich Drepper  <drepper@redhat.com>
223         * sysdeps/pthread/timer_routines.c (thread_func): Make the
224         compiler happy by adding a return statement which will never be
225         reached.
227         * tst-context.c (main): Cast to long before casting to pointer.
229         * Examples/ex17.c (main): Use correct format string.
231         * Examples/ex9.c (thread): Remove incorrect return statement.
233 2002-08-23  Ulrich Drepper  <drepper@redhat.com>
235         * pthread.c (__linuxthreads_version): New global constant.
237 2002-08-23  Andreas Jaeger  <aj@suse.de>
239         * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
240         as thread specific register.
241         (testandset): Fix inline asm.
242         (THREAD_GETMEM): Fix inline asm.
244 2002-08-22  Roland McGrath  <roland@redhat.com>
246         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
247         conditional.
248         (INIT_THREAD_SELF): Pass second arg to DO_SET_THREAD_AREA.
249         (DO_SET_THREAD_AREA): Take second arg, pass to DO_SET_THREAD_AREA_REUSE
250         macro.  That chooses whether to reuse %gs value or let kernel set it.
251         [USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, always 1.
252         [!USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, true if arg is
253         not constant 0.
255 2002-08-21  Ulrich Drepper  <drepper@redhat.com>
257         * sysdeps/i386/tls.h (TLS_SETUP_GS_SEGMENT): Add new parameter
258         also to the third definition of this macro.
260 2002-06-17  Andreas Jaeger  <aj@suse.de>
262         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
263         Set it.
265 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
267         * sysdeps/i386/useldt.h: Go back to using 16-bit instructions when
268         loading/reading segment registers.  Some old hardware doesn't
269         handle the 32-bit instructions as expected.
270         * sysdeps/i386/tls.h: Likewise.
272         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
273         renamed to secondcall and use is negated.
274         (TLS_SETUP_GS_SEGMENT): Likewise.
275         (TLS_INIT_TP): Likewise.
276         * sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
277         secondcall.
279         * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
280         registers.  No need to mask upper 16 bits in this case.
281         * sysdeps/i386/useldt.h: Likewise.
282         (DO_SET_THREAD_AREA): We have to load %gs again even if the value
283         is the same since the GDT content changed.
285         * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
286         to TLS_SETUP_GS_SEGMENT.
287         (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
288         TLS_DO_SET_THREAD_AREA.
289         (TLS_DO_SET_THREAD_AREA): If new parameter is zero determine
290         entry number from %gs value.
291         * sysdeps/sh/tls.h (TLS_INIT_TP): Add new parameter and simply
292         ignore it.
294         * manager.c (pthread_handle_create): Pass NULL to _dl_allocate_tls.
295         Pass true to _dl_deallocate_tls.
296         (pthread_free): Likewise.
297         * pthread.c (__pthread_initialize_manager): Likewise.
299 2002-08-19  Ulrich Drepper  <drepper@redhat.com>
301         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Use correct shift when
302         computing index from %gs value.
304 2002-08-16  Roland McGrath  <roland@redhat.com>
306         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Calculate segment
307         register value from entry number properly.
309         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Rewrite asm to use %ebx
310         optimally conditional on [__PIC__].
311         (TLS_DO_SET_THREAD_AREA): New macro, implement inline syscall
312         without touching errno, and use latest modify_ldt-like interface.
313         (TLS_SETUP_GS_SEGMENT): Use that instead of INLINE_SYSCALL.
314         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Set %gs in this macro.
315         (DO_SET_THREAD_AREA): New macro, uses current syscall interface with
316         existing %gs value as the segment to set.
317         (INIT_THREAD_SELF): Rewritten using those.  Use set_thread_area only
318         under [HAVE_TLS_SUPPORT] so we can rely on the initialization done
319         by the first thread's early TLS setup.
321 2002-08-15  Roland McGrath  <roland@redhat.com>
323         * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
324         return a value as callers now expect.
326 2002-08-11  Roland McGrath  <roland@redhat.com>
328         * pthread.c (__pthread_initialize_manager): Initialize
329         p_header.data.tcb field of manager thread's descriptor.
330         (__pthread_initialize_minimal): Don't initialize p_header.data.self
331         field, already done by TLS_INIT_TP.
333         * manager.c (pthread_handle_create): Move p_header field initializers
334         together.
336 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
338         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
340 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
342         * pthread.c (__linuxthreads_initial_report_events): New variable.
343         (__pthread_initialize_manager): Use it to initialize p_report_events
344         of initial thread.
345         [TLS]: Store pointer to descriptor of manager in __pthread_handles.
347 2002-08-07  Roland McGrath  <roland@redhat.com>
349         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Add an extra argument with
350         an "m" constraint to the asm so the compiler knows LDT_ENTRY was used.
352 2002-08-02  Roland McGrath  <roland@redhat.com>
354         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t):
355         Add _LIBC_TSD_KEY_LOCALE.
356         * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
357         Call __uselocale to initialize our per-thread locale pointer to
358         the global one.
359         * pthread.c (__pthread_initialize_minimal): Likewise.
361         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Add missing \s.
363 2002-08-02  Ulrich Drepper  <drepper@redhat.com>
365         * pthread.c: Declare _errno, _h_errno, and _res unless we use TLS
366         internally.
368         * cancel.c (__pthread_perform_cleanup) [USE_TLS && HAVE___THREAD]:
369         Don't use p_libc_specific element in thread descriptor.
371 2002-07-30  Roland McGrath  <roland@redhat.com>
373         * sysdeps/pthread/bits/libc-tsd.h: Include <tls.h>.
374         [USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
375         which does the right thing when __thread support is available.
376         * descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
377         Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
378         `p_h_errno', `p_resp', and `p_res' members.
379         * pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
380         Don't initialize `p_errnop' and `p_h_errnop' members.
381         (__pthread_reset_main_thread): Likewise.
382         (__pthread_initialize_manager): Likewise.
383         * manager.c (__pthread_manager, pthread_handle_create): Likewise.
384         * pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
385         Don't initialize `p_resp' member.
386         (__pthread_reset_main_thread): Likewise.
387         * manager.c (pthread_handle_create): Likewise.
388         * specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
389         Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
390         * no-tsd.c: Conditionalize contents on [!(USE_TLS && HAVE___THREAD)].
391         * errno.c [USE_TLS && HAVE___THREAD]
392         (__h_errno_location, __res_state): Don't define these at all.
394         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
395         (INSTALL_NEW_DTV, GET_DTV): Likewise.
396         * sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
398         * weaks.c: Don't include <errno.h> here.
400 2002-08-01  Roland McGrath  <roland@redhat.com>
402         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
403         TLS_INIT_TP.
404         (TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
405         (TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
406         (TLS_INIT_TP): Use that.
408 2002-08-02  Jakub Jelinek  <jakub@redhat.com>
410         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Move from INIT_THREAD_SELF.
411         (INIT_THREAD_SELF): Use sys_thread_area syscall instead if available.
412         (FREE_THREAD): Avoid modify_ldt if using GDT.
413         * sysdeps/i386/pspinlock.c (__have_no_set_thread_area): New variable.
415 2002-07-25  Jakub Jelinek  <jakub@redhat.com>
417         * sysdeps/i386/tls.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
418         * sysdeps/i386/pt-machine.h: Likewise.
419         * sysdeps/i386/useldt.h: Likewise.
421 2002-07-22  Ulrich Drepper  <drepper@redhat.com>
423         * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
424         call __libc_setup_tls first.
425         * Makefile: Actually create tst-signal.out file when running the test.
426         (tests): Add tststatic.
427         * Examples/tststatic.c: New file.
429 2002-07-19  Ulrich Drepper  <drepper@redhat.com>
431         * errno.c (__errno_location): Don't define unless !USE_TLS
432         || !HAVE___THREAD.
433         * sysdeps/i386/pt-machine.c: Protect C code with #ifndef ASSEMBLER.
434         * sysdeps/i386/tls.h: Likewise.
435         * sysdeps/i386/useldt.h: Likewise.
436         * sysdeps/i386/i686/pt-machine.h: Likewise.
438 2002-07-02  H.J. Lu  <hjl@gnu.org>
440         * sysdeps/mips/pspinlock.c: Don't include <sgidefs.h>.  Always
441         use ll/sc.
442         * sysdeps/mips/pt-machine.h: Likewise.
444 2002-07-14  Ulrich Drepper  <drepper@redhat.com>
446         * manager.c (pthread_handle_create): Initialize self-reference in
447         descriptor.
449 2002-07-01  Jakub Jelinek  <jakub@redhat.com>
451         * Examples/ex9.c (main): Remove unused th variable.
453 2002-07-10  Ulrich Drepper  <drepper@redhat.com>
455         * wrapsyscall.c: Add __nanosleep alias.
456         * Versions (GLIBC_2.2.6): Add __nanosleep.
457         * bug-sleep.c: New file.
458         * Makefile (tests): Add bug-sleep.
460 2002-06-19  Steven Munroe  <sjmunroe@vnet.ibm.com>
462         * Examples/ex9.c (main):  Use list of children and join them.
463         (thread): Do not call exit.
465 2002-06-20  Ulrich Drepper  <drepper@redhat.com>
467         * spinlock.c (wait_node_alloc): We cannot use compare-and-exchange.
468         Unconditionally use the code using spinlock.  Use __pthread_release
469         to free a spinlock.
470         (wait_node_free): Likewise.
471         (__pthread_acquire, __pthread_release): Unconditionally define.
473 2002-06-07  Jakub Jelinek  <jakub@redhat.com>
475         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Fix typo.
477 2002-05-24  Ulrich Drepper  <drepper@redhat.com>
479         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Use __sync_synchronize.
481 2002-05-21  Ulrich Drepper  <drepper@redhat.com>
483         * sysdeps/pthread/pthread.h (pthread_create): Rename first
484         parameter.
485         (pthread_cancel): Likewise.
486         * internals.h (__pthread_create_2_1): Likewise.
487         * sysdeps/unix/sysv/linux/bits/sigthread.h (pthread_kill): Likewise.
489 2002-05-20  Ulrich Drepper  <drepper@redhat.com>
491         * sysdeps/alpha/pt-machine.c (THREAD_SELF): Remove clobber.
492         Patch by Glen Nakamura <gen@flex.com>.
494 2002-05-03  Ulrich Drepper  <drepper@redhat.com>
496         * signals.c: Move sighandler functions to...
497         * sighandler.c: ...here.  New file.
498         * signals.c: Move signal handler related type definitions to...
499         * internals.h: ...here.  Add prototypes for signal handlers.
500         * Makefile (libpthread-routines): Add sighandler.
501         (CFLAGS-sighandler.c): Add $(exceptions).
503 2002-04-30  Jakub Jelinek  <jakub@redhat.com>
505         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
507 2002-04-08  Ulrich Drepper  <drepper@redhat.com>
509         * sysdeps/pthread/timer_getoverr.c: Return real overrun.
510         * sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
511         * sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
512         based on previous one and not on current time.  Count overruns.
513         Patch by Eric F. Sorton <eric@cctcorp.com>.
515         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
517 2002-04-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
519         * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
520         if it isn't defined yet.
521         (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
522         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
523         Likewise.
524         * sysdeps/sh/tls.h: New file.
526 2002-04-08  Jakub Jelinek  <jakub@redhat.com>
528         * manager.c (__pthread_manager_event): Use self instead of arg
529         for INIT_THREAD_SELF.
530         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct
531         _pthread_descr_struct) instead of sizeof (*descr).
533 2002-04-05  Ulrich Drepper  <drepper@redhat.com>
535         * sysdeps/ia64/pt-machine.h: Protect against multiple inclusion.
536         * sysdeps/alpha/pt-machine.h: Likewise.
537         * sysdeps/arm/pt-machine.h: Likewise.
538         * sysdeps/cris/pt-machine.h: Likewise.
539         * sysdeps/hppa/pt-machine.h: Likewise.
540         * sysdeps/m68k/pt-machine.h: Likewise.
541         * sysdeps/mips/pt-machine.h: Likewise.
542         * sysdeps/powerpc/pt-machine.h: Likewise.
543         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
544         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
545         * sysdeps/sh/pt-machine.h: Likewise.
546         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
547         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
548         * sysdeps/x86_64/pt-machine.h: Likewise.
550 2002-04-05  Jakub Jelinek  <jakub@redhat.com>
552         * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document
553         instead of pthread_mutexattr_setkind_np.
554         (pthread_mutexattr_gettype): Similarly.
555         * man/pthread_mutexattr_setkind_np.man: New.
556         * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man.
558 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
560         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Define.
562 2002-03-22  Jakub Jelinek  <jakub@redhat.com>
564         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Remove.
566 2002-03-22  Ulrich Drepper  <drepper@redhat.com>
568         * internals.h (MEMORY_BARRIER): Define as asm with memory as clobber.
570 2002-03-17  Andreas Jaeger  <aj@suse.de>
572         * sysdeps/i386/pt-machine.h: Add testandset and __compare_and_swap
573         prototpyes.
574         * sysdeps/alpha/pt-machine.h: Likewise.
575         * sysdeps/arm/pt-machine.h: Likewise.
576         * sysdeps/cris/pt-machine.h: Likewise.
577         * sysdeps/hppa/pt-machine.h: Likewise.
578         * sysdeps/i386/i686/pt-machine.h: Likewise.
579         * sysdeps/ia64/pt-machine.h: Likewise.
580         * sysdeps/m68k/pt-machine.h: Likewise.
581         * sysdeps/mips/pt-machine.h: Likewise.
582         * sysdeps/powerpc/pt-machine.h: Likewise.
583         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
584         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
585         * sysdeps/sh/pt-machine.h: Likewise.
586         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
587         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
588         * sysdeps/x86_64/pt-machine.h: Likewise.
590         * internals.h: Move testandset and __compare_and_swap prototypes
591         to pt-machine.h.
593 2002-03-03  Andreas Jaeger  <aj@suse.de>
595         * errno.c: Include resolv.h to avoid warning.
597 2002-02-27  Ulrich Drepper  <drepper@redhat.com>
599         * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
600         stack limit.
602 2002-02-23  Ulrich Drepper  <drepper@redhat.com>
604         * attr.c (pthread_getattr_np): Don't take thread descriptor size
605         into account if USE_TLS.
606         * manager.c (pthread_handle_create): Free TLS data structures if call
607         failed.  Pass correct stack to clone if USE_TLS.
608         * sysdeps/i386/pt-machine.h: Handle multiple inclusion.
609         * sysdeps/i386/i686/pt-machine.h: Likewise.
610         * sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
612         * descr.h (struct _pthread_descr_struct): Update p_header for TLS.
613         Add p_stackaddr element #if USE_TLS.
614         * internals.c: Include <tls.h>.
615         * manager.c: Integrate creating and handling of thread descriptor
616         for TLS.
617         * pthread.c: Likewise.
618         * sysdeps/i386/tls.h (tcbhead_t): Add self pointer.
619         Include <linuxthreads/descr.h> only if TLS is really used.
620         (GET_DTV): New macro.
621         (TLS_INIT_TP): Initialize self pointer.
623 2002-02-17  Andreas Schwab  <schwab@suse.de>
625         * signals.c (sigwait): Check for old sighandler being SIG_ERR,
626         not NULL.
628 2002-02-12  Ulrich Drepper  <drepper@redhat.com>
630         * sysdeps/i386/tls.c (INSTALL_NEW_DTV): Define.
631         (INSTALL_DTV): Adjust for being passed pointer to element with length.
633 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
635         * sysdeps/i386/tls.h (TLS_INIT_TP): Also initialize %gs.
637 2002-02-08  Richard Henderson  <rth@redhat.com>
639         * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string.
641 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
643         * sysdeps/i386/tls.h: TLS cannot be supported with FLOATING_STACKS
644         after all.
646 2002-02-07  H.J. Lu  <hjl@gnu.org>
648         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Silence the
649         gcc warning.
650         (__pthread_spin_lock): Remove ".set noreorder".
651         * sysdeps/mips/pt-machine.h (__compare_and_swap): Liekwise.
653 2002-02-05  H.J. Lu  <hjl@gnu.org>
655         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Not use
656         branch likely.
657         * sysdeps/mips/pt-machine.h (testandset): Likewise.
658         (__compare_and_swap): Likewise.
660 2002-02-07  Ulrich Drepper  <drepper@redhat.com>
662         * internals.h: Move declarations/definitions of
663         __pthread_initial_thread_bos, __pthread_initial_thread,
664         __pthread_manager_thread_bos, __pthread_manager_thread_tos,
665         __pthread_manager_thread, __pthread_nonstandard_stacks, STACK_SIZE,
666         CURRENT_STACK_FRAME, __pthread_find_self, and thread_self...
667         * descr.h: ...here.
668         * sysdeps/i386/tls.h: Add TLS definitions also for !FLOATING_STACKS.
669         Define THREAD_GETMEM accordingly.
671 2002-02-06  Ulrich Drepper  <drepper@redhat.com>
673         * sysdeps/i386/tls.h: Include <stddef.h> for size_t.
675         * sysdeps/i386/tls.h: Define THREAD_DTV.
677 2002-02-04  Ulrich Drepper  <drepper@redhat.com>
679         * internals.h: Move thread descriptor definition...
680         * descr.h.: ...here.  New file.
681         * sysdeps/i386/tls.h: New file.
683 2002-02-01  H.J. Lu  <hjl@gnu.org>
685         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Use a
686         different register in the delayed slot.  Use branch likely.
688         * sysdeps/mips/pt-machine.h (testandset): Call _test_and_set.
689         (__compare_and_swap): Return 0 only when failed to compare. Use
690         branch likely.
692 2002-02-01  Jakub Jelinek  <jakub@redhat.com>
694         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set,
695         __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE.
696         * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE.
697         * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE.
698         * sysdeps/sparc/sparc32/sparcv9/Versions: New file.
699         * sysdeps/sparc/sparc64/Versions: New file.
700         * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE.
702 2002-01-31  Ulrich Drepper  <drepper@redhat.com>
704         * pthread.c: _dl_cpuclock_offset is not any longer a global variable
705         in SHARED code, use GL(dl_cpuclock_offset).
707 2002-01-28  Andreas Jaeger  <aj@suse.de>
709         * sysdeps/mips/pspinlock.c (__pthread_spin_init): Clear *LOCK to
710         0. Patch by Machida Hiroyuki <machida@sm.sony.co.jp>.
712 2002-01-16  Martin Schwidefsky  <schwidefsky@de.ibm.com>
714         * sysdeps/s390/s390-32/pt-machine.h (MEMORY_BARRIER): Define.
715         (CURRENT_STACK_FRAME): Remove duplicate definition.
716         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
718 2002-01-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
720         * Makefile (CFLAGS-tst-cancel.c): Add -fno-inline-functions to prevent
721         automatic inline.
723 2002-01-12  Andreas Schwab  <schwab@suse.de>
725         * Makefile (test-srcs): Add tst-signal.
726         (tests): Run tst-signal.
727         (distribute): Add tst-signal.sh.
728         * tst-signal.c, tst-signal.sh: New files.
730 2002-01-14  Andreas Jaeger  <aj@suse.de>
732         * sysdeps/x86_64/pt-machine.h (INIT_THREAD_SELF): Avoid warning.
734 2002-01-11  Andreas Schwab  <schwab@suse.de>
736         * signals.c (sighandler): Initialize all elements to SIG_ERR.
737         (__sigaction): Don't use value from sighandler if it is SIG_ERR.
739 2002-01-06  Richard Henderson  <rth@redhat.com>
741         * sysdeps/alpha/elf/pt-initfini.c: New file.
743 2001-12-29  Andreas Jaeger  <aj@suse.de>
745         * Examples/ex9.c: Add noreturn attribute for thread.
746         * Examples/ex10.c: Likewise.
747         * Examples/ex13.c (thread_start): Likewise.
748         * Examples/ex15.c (worker): Likewise.
750         * Examples/ex18.c: Include unistd.h for prototype of sleep.
752 2001-12-14  Ulrich Drepper  <drepper@redhat.com>
754         * man/pthread_atfork.man: Adjust description of mutex handling
755         after fork for current implementation.
756         * linuxthreads.texi: Likewise [PR libc/2519].
758 2001-12-13  Andreas Schwab  <schwab@suse.de>
760         * specific.c (pthread_key_delete): Don't contact the thread
761         manager if no threads have been created yet.
763 2001-12-12  NIIBE Yutaka  <gniibe@m17n.org>
765         * sysdeps/sh/pt-machine.h (INIT_THREAD_SELF): Added __volatile__
766         qualifier to be safe.
768 2001-11-30  Andreas Schwab  <schwab@suse.de>
770         * pthread.c (pthread_handle_sigcancel) [THREAD_SELF]: Double check
771         that self is the manager thread, and initialize the thread
772         register if not.
773         (thread_self_stack) [THREAD_SELF]: New function to find self via
774         stack pointer.
775         * manager.c (pthread_handle_create): Don't block cancel signal any
776         more.
778 2001-11-29  Andreas Jaeger  <aj@suse.de>
780         * sysdeps/x86_64/pt-machine.h: Use %gs as thread specific register.
781         (THREAD_SELF): New.
782         (INIT_THREAD_SELF): New.
783         (THREAD_GETMEM): New.
784         (THREAD_GETMEM_NC):
785         (THREAD_SETMEM): New.
786         (THREAD_SETMEM_NC): New.
787         (FLOATING_STACKS): Define.
788         (ARCH_STACK_MAX_SIZE): Define.
790 2001-11-28  Kaz Kylheku  <kaz@ashi.footprints.net>
792         Bugfix to pthread_key_delete. It was iterating over the thread
793         manager's linked list of threads, behind the thread manager's
794         back causing a race. The fix is to have the manager iterate over
795         the threads instead, using a new request type for doing so.
796         * internals.h (struct pthread_request): New manager request type
797         REQ_FOR_EACH_THREAD.
798         * manager.c (pthread_for_each_thread): New function.
799         (__pthread_manager): Handle new REQ_FOR_EACH_THREAD request.
800         * specific.c (struct pthread_key_delete_helper_args): New type.
801         (pthread_key_delete_helper): New static function.
802         (pthread_key_delete): Use the new thread manager
803         REQ_FOR_EACH_THREAD function to iterate over the threads and set
804         the delete key slot to a null value in each thread.
805         * Examples/ex18.c: New test.
806         * Makefile (tests): Add ex18.
808 2001-11-22  Wolfram Gloger  <wg@malloc.de>
810         * pthread.c (pthread_onexit_process): Don't call free
811         after threads have been asynchronously terminated.
813         * manager.c (pthread_handle_exit): Surround cancellation
814         of threads with __flockfilelist()/__funlockfilelist().
816 2001-11-26  Andreas Schwab  <schwab@suse.de>
818         * manager.c (pthread_handle_create): Start the child thread with
819         the cancel signal blocked, so that it does not handle it before
820         the thread register is set up.  Save errno from failed clone call.
822 2001-11-15  Ulrich Drepper  <drepper@redhat.com>
824         * sysdeps/i386/i686/Implies: Removed.
825         * sysdeps/i386/i686/Versions: New file.
827 2001-10-31  Andreas Jaeger  <aj@suse.de>
829         * sysdeps/x86_64/Makefile: Remove, we do not need it anymore.
831 2001-10-05  Kevin Buettner  <kevinb@cygnus.com>
833         * pthread.c (__linuxthread_pthread_sizeof_descr): Change name
834         to __linuxthreads_pthread_sizeof_descr to match name used by
835         symbol_list_arr[LINUXTHREADS_PTHREAD_SIZEOF_DESCR] in
836         linuxthreads_db/td_symbol_list.c.
838 2001-09-22  Andreas Jaeger  <aj@suse.de>
840         * linuxthreads/tst-context.c: Avoid compile warning.
842 2001-09-20  Andreas Jaeger  <aj@suse.de>
844         * shlib-versions: Add x86-64.
846 2001-09-19  Andreas Jaeger  <aj@suse.de>
848         * sysdeps/x86_64/Makefile: New file.
849         * sysdeps/x86_64/pspinlock.c: New file.
850         * sysdeps/x86_64/pt-machine.h: New file.
852 2001-09-12  Jakub Jelinek  <jakub@redhat.com>
854         * sysdeps/pthread/timer_delete.c (timer_delete): Thread may be NULL
855         for SIGEV_NONE.
856         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
858 2001-09-11  Ulrich Drepper  <drepper@redhat.com>
859             Wolfram Gloger <wg@malloc.de>
861         * join.c: Protect all communications from and to manager with
862         TEMP_FAILURE_RETRY.
863         * manager.c: Likewise.
864         * pthread.c: Likewise.
865         * smeaphore.c: Likewise.
867 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
869         * spinlock.c (__pthread_lock): Top max_count value with
870         MAX_ADAPTIVE_SPIN_COUNT.
871         * internals.h (MAX_ADAPTIVE_SPIN_COUNT): Define if not already done.
873         * sysdeps/i386/i686/pt-machine.h (BUSY_WAIT_NOP): New macro to
874         help P4.
876 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
878         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
879         non-opaque type if __USE_UNIX98.
881 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
883         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
884         non-opaque lock types also if _IO_MTSAFE_IO is defined.
886 2001-08-23  Roland McGrath  <roland@frob.com>
888         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start): Take
889         new first argument, skip the cleanup handler if it's zero.
890         (_LIBC_LOCK_RECURSIVE_INITIALIZER): New macro.
891         (__libc_lock_define_initialized_recursive): Use it.
892         * sysdeps/pthread/bits/stdio-lock.h: File removed.
893         The sysdeps/generic file from the main tree now suffices.
895 2001-08-22  Roland McGrath  <roland@frob.com>
897         * sysdeps/pthread/bits/stdio-lock.h: Include <bits/libc-lock.h>
898         instead of <pthread.h>.
899         (_IO_lock_t): Define this typedef using __libc_lock_define_recursive.
900         (_IO_lock_initializer): Add braces.
901         (_IO_lock_lock): Use __libc_lock_lock_recursive.
902         (_IO_lock_unlock): Use __libc_lock_unlock_recursive.
904         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_recursive_t): New type.
905         (__libc_lock_define_initialized_recursive): Use it.
906         (__libc_lock_init_recursive): Likewise.
907         (__libc_lock_fini_recursive): Likewise.
908         (__libc_lock_lock_recursive): Likewise.
909         (__libc_lock_trylock_recursive): Likewise.
910         (__libc_lock_unlock_recursive): Likewise.
911         (__libc_lock_define_recursive): New macro.
913 2001-08-14  Jakub Jelinek  <jakub@redhat.com>
915         * lockfile.c (__pthread_provide_lockfile): New variable.
916         * pthread.c (__pthread_require_lockfile): New variable.
917         * cancel.c (__pthread_require_lockfile): New variable.
919 2001-07-31  Ulrich Drepper  <drepper@redhat.com>
921         * tst-context.c (threadfct): Initialize context before calling
922         makecontext.
924         * Examples/ex17.c: Make sure test thread is around long enough.
926 2001-07-26  kaz Kojima  <kkojima@rr.iij4u.or.jp>
928         * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
930 2001-07-24  Ulrich Drepper  <drepper@redhat.com>
932         * tst-context.c (main): Print explanation before bailing out
933         because context handling is not supported.
935 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
937         * Makefile (tests): Add tst-context.
938         * tst-context.c: New file.
940         * sysdeps/pthread/bits/stdio-lock.h: Define
941         _IO_cleanup_region_start_noarg.
943 2001-07-23  Jakub Jelinek  <jakub@redhat.com>
945         * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
946         (ARCH_STACK_MAX_SIZE): Define.
947         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
948         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
950 2001-07-19  Jakub Jelinek  <jakub@redhat.com>
952         * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
954         * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
955         (ARCH_STACK_MAX_SIZE): Define.
956         * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
957         NEED_SEPARATE_REGISTER_STACK.
959 2001-07-16  Andreas Schwab  <schwab@suse.de>
961         * Makefile (before-compile): Don't add $(objpfx)crti.o.
962         (omit-deps): Add crti.
963         ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
964         it is filtered out of the link command.
966 2001-07-16  Ulrich Drepper  <drepper@redhat.com>
968         * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
969         to find the right value for __pthread_initial_thread_bos, it's not
970         used.  If not FLOATING_STACKS first run
971         __pthread_init_max_stacksize.
973 2001-06-16  H.J. Lu  <hjl@gnu.org>
975         * internals.h: Include <stackinfo.h>.
977         * attr.c: Don't include <stackinfo.h> here.
978         * cancel.c: Likewise.
979         * manager.c: Likewise.
980         * pthread.c: Likewise.
981         * ptlongjmp.c: Likewise.
983 2001-03-23  Matthew Wilcox  <willy@ldl.fc.hp.com>
985         * attr.c: Make _STACK_GROWS_UP work.
986         * internals.h: Likewise.
987         * manager.c: Likewise.
988         * pthread.c: Likewise.
990 2001-06-15  H.J. Lu  <hjl@gnu.org>
992         * pthread.c (__pthread_reset_main_thread): Fix a typo.
994 2001-02-02  John S. Marvin  <jsm@udlkern.fc.hp.com>
996         * semaphore.h: Use struct _pthread_fastlock as an element of
997         sem_t instead of an identical struct.
998         * rwlock.c: Remove casts.
999         * semaphore.c: Likewise.
1001 2001-04-30  Alan Modra  <amodra@one.net.au>
1003         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
1005 2001-05-25  Bruce Mitchener  <bruce@cubik.org>
1007         * linuxthreads.texi: Spelling corrections.
1009 2001-05-25  Ulrich Drepper  <drepper@redhat.com>
1011         * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
1012         returning successfully.
1013         Patch by Gene Cooperman <gene@ccs.neu.edu>.
1015 2001-05-24  Ulrich Drepper  <drepper@redhat.com>
1017         * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
1018         serious work try once whether the lock is uncontested.
1019         Remove duplicate reading of __status before loop.
1020         Change suggested by Hans Boehm <hans_boehm@hp.com>.
1022         * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
1023         (__pthread_alt_trylock): Likewise.
1025 2001-05-01  Kaz Kylheku  <kaz@ashi.footprints.net>
1027         Memory barrier overhaul following line by line inspection.
1028         * mutex.c (pthread_once): Missing memory barriers added.
1029         * pthread.c (__pthread_wait_for_restart_signal,
1030         __pthread_timedsuspend_new, __pthread_restart_new): Added
1031         memory barriers ``just in case'' and for documentary value.
1032         * spinlock.c (__pthread_release): New inline function for releasing
1033         spinlock, to complement __pthread_acquire.  Includes memory
1034         barrier prior to assignment to spinlock, and __asm __volatile
1035         dance to prevent reordering or optimization of the spinlock access.
1036         * spinlock.c (__pthread_unlock, __pthread_alt_lock,
1037         __pthread_alt_timedlock, __pthread_alt_unlock,
1038         __pthread_compare_and_swap): Updated to use new __pthread_release
1039         instead of updating spinlock directly.
1040         * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
1041         wait_node_free, wait_node_dequeue, __pthread_alt_lock,
1042         __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
1043         Memory barrier overhaul.  Lots of missing memory barriers added,
1044         a couple needless ones removed.
1045         * spinlock.c (__pthread_compare_and_swap): testandset optimization
1046         removed, just calls __pthread_acquire, which has the new read
1047         barrier in it before its testandset.
1049 2001-05-20  Roland McGrath  <roland@frob.com>
1051         * Makeconfig: New file, variables used to be in main libc Makeconfig.
1053 2001-05-09  Geoff Keating  <geoffk@redhat.com>
1055         * sysdeps/powerpc/pt-machine.h
1056         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
1057         (__compare_and_swap): Remove memory barriers.
1058         (__compare_and_swap_with_release_semantics): New function.
1060 2001-04-24  Andreas Jaeger  <aj@suse.de>
1062         * wrapsyscall.c: send* and recv* return ssize_t.
1064         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
1065         mutex instead of double locking it.
1066         Reported by Pierre Artaud <partaud@sodatec.com>.
1068 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
1070         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
1071         using #ifdef whether the clock is available.
1072         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
1074         * sysdeps/ia64/Versions: New file.
1076         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
1077         have to call __gmon_start__ in the libpthread DSO.
1078         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
1080         * Makefile (libpthread-routines): Add ptclock_gettime and
1081         ptclock_settime.
1082         * internals.h: Don't use cpuclock-init.h definitions, use
1083         hp-timing.h definitions.
1084         * pthread.c: Likewise.
1085         * manager.c: Likewise.
1086         * ptclock_gettime.c: New file.
1087         * ptclock_settime.c: New file.
1088         * internals.h: Fix parameter type for __pthread_clock_gettime and
1089         __pthread_clock_settime.
1091         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
1092         * sysdeps/i386/i586/ptclock_settime.c: Removed.
1093         * sysdeps/i386/i586/Makefile: Removed.
1095 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
1097         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
1098         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1100 2001-04-21  Andreas Jaeger  <aj@suse.de>
1102         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
1103         attribute, remove statements that will never be executed.
1104         (thread_func): Remove mutex_unlock call since it's never executed.
1105         (thread_func): Fix comment as suggested by Jakub Jelinek.
1107         * manager.c (__pthread_manager): Add noreturn
1108         attribute.
1109         (pthread_start_thread): Likewise, remove return statement.
1110         (pthread_start_thread_event): Likewise.
1111         Add noreturn attribute for pthread_handle_exit.
1112         * weaks.c: Add noreturn attribute for pthread_exit.
1114         * internals.h: Add __pthread_clock_gettime and
1115         __pthread_clock_settime prototypes.
1117 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
1119         * internals.h: Include <cpuclock-init.h>.
1120         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
1121         CPUCLOCK_VARDEF is defined.
1122         * pthread.c (__pthread_initialize_minimal): Initialize
1123         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
1124         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
1125         for new thread to current CPU clock value.
1127         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
1129         * sysdeps/i386/i586/Makefile: New file.
1130         * sysdeps/i386/i586/Versions: New file.
1131         * sysdeps/i386/i586/ptclock_gettime.c: New file.
1132         * sysdeps/i386/i586/ptclock_settime.c: New file.
1133         * sysdeps/i386/i686/Implies: New file.
1135 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1137         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
1138         $generated, not $postclean-generated.
1140 2001-04-18  Andreas Jaeger  <aj@suse.de>
1142         * Makefile (otherlibs): Added.
1144 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
1146         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1148 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
1150         * signals.c (sigwait): NSIG is no signal number.  Block all
1151         signals while in signal handler for signals in SET.
1152         Patch by Manfred Spraul <manfred@colorfullife.com>.
1154 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
1156         * tst-cancel.c: Disable most tests.  Add new test where all
1157         cleanup handlers must run.
1158         * Makefile (tests): Add tst-cancel again.
1160         * cancel.c (__pthread_perform_cleanup): Correct condition for
1161         leaving cleanup loop early.
1163         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
1164         all the files which use CURRENT_STACK_FRAME.
1165         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
1166         __builtin_frame_address.
1167         * sysdeps/i386/i686/pt-machine.h: Likewise.
1169 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1171         * Makefile (tests): Comment out tst-cancel for now.
1173         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
1174         temporary file in object directory.
1175         * Makefile: Don't allow inlining when compiling tst-cancel.c.
1176         Pass $(objpfx) to tst-cancel.
1178 2001-04-11  David S. Miller  <davem@redhat.com>
1180         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
1181         up closer to user local variables so that new cleanup heuristics work.
1182         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
1184 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
1186         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
1187         and remove it.
1188         (_pthread_cleanup_push_defer): Likewise.
1190         * tst-cancel.c (main): Fix loop printing cleanup output.
1192 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1194         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
1195         test.
1196         (__pthread_spin_trylock): Likewise.
1197         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1199 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
1201         * join.c (pthread_exit): Move code to new function __pthread_do_exit
1202         which takes an extra parameter with the current frame pointer.
1203         Call new function with CURRENT_STACK_FRAME.
1204         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
1205         with the new parameter.
1206         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
1207         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
1208         this parameter as the initial value the cleanup handler records are
1209         compared against.  No active cleanup handler record must have an
1210         address lower than the previous one and the initial record must be
1211         above (below on PA) the frame address passed in.
1212         (pthread_setcancelstate): Call __pthread_do_exit instead of
1213         pthread_exit.
1214         (pthread_setcanceltype): Likewise.
1215         (pthread_testcancel): Likewise.
1216         (_pthread_cleanup_pop_restore): Likewise.
1217         * condvar.c (pthread_cond_wait): Likewise.
1218         (pthread_cond_timedwait_relative): Likewise.
1219         * manager.c (pthread_start_thread): Likewise.
1220         * oldsemaphore.c (__old_sem_wait): Likewise.
1221         * pthread.c (pthread_handle_sigcancel): Likewise.
1222         * semaphore.c (__new_sem_wait): Likewise.
1223         (sem_timedwait): Likewise.
1224         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
1225         to limit the cleanup handlers which get run.
1226         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
1227         for __pthread_perform_cleanup.
1229         * Makefile (tests): Add tst-cancel.
1230         * tst-cancel.c: New file.
1232 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
1234         * sysdeps/cris/pt-machine.h: New file.
1235         * sysdeps/cris/pspinlock.c: New file.
1237 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
1239         * shlib-versions: Add case for Linux on CRIS.
1241 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
1243         * attr.c (pthread_getattr_np): Correct computation of stack size
1244         for machiens with register stack.
1246         * Examples/ex17.c (main): Correct detection of failed mmap call.
1248 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1250         * pthread.c (__pthread_initialize_manager): Fix a typo.
1252 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1254         * attr.c (__pthread_attr_setstack): Fix alignment check.
1255         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
1256         * Makefile (tests): Add ex17 test.
1257         * Examples/ex17.c: New test.
1259 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
1261         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
1262         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
1263         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
1265 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
1267         * Makefile: When generating DSO link with libc_nonshared.a.
1269 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
1271         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
1273 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
1275         * internals.h (__pthread_init_max_stacksize): New prototype.
1276         * attr.c (__pthread_attr_setstacksize): Call
1277         __pthread_init_max_stacksize if not yet initialized.
1278         * pthread.c (__pthread_init_max_stacksize): New function.
1279         (__pthread_initialize_manager): Call it.
1280         Patch by <dtc@cmucl.cons.org>.
1282 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
1284         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
1286 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1288         * shlib-versions: Add rule for Linux on 64 bit S/390.
1289         * sysdeps/s390/s390-64/pt-machine.h: New file.
1290         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
1292 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1294         * sysdeps/s390/pt-machine.h: Move to...
1295         * sysdeps/s390/s390-32/pt-machine.h: ...here.
1296         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
1298 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
1300         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
1301         * attr.c: Implement pthread_getattr_np.
1302         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
1303         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
1304         * manager.c (pthread_handle_create): Initialize p_inheritsched.
1306 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1308         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
1309         code alignment.
1311 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
1313         * manager.c (manager_mask): Removed static vesion.  Now always local
1314         to __pthread_manager().
1315         (manager_mask_all): Removed completely.
1316         (__pthread_manager): Remove manager_mask_all initialization.
1317         (pthread_handle_create): Remove code to set and reset signal mask
1318         around __clone2() calls.
1320 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
1322         * spinlock.c (__pthread_lock): Force lock->__status to be read from
1323         memory on every spin.
1325 2001-02-10  Andreas Jaeger  <aj@suse.de>
1327         * Makefile (extra-objs): New.
1329 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
1331         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
1332         __pthread_initialize_minimal prototype.
1334 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1336         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
1338 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1340         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
1342 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
1344         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
1345         broken code.  Patch by Jes Sorensen.
1347 2001-02-06  Andreas Jaeger  <aj@suse.de>
1349         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
1350         to...
1351         * internals.h: ...here.
1353 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
1355         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1357 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
1359         * Versions: Remove __pthread_initialize_minimal.
1361 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
1363         * Makefile: Add rules to build crti.o and make it being used in
1364         building libpthread.so.
1365         * sysdeps/i386/Makefile: New file.
1366         * sysdeps/pthread/pt-initfini.c: New file.
1368         * pthread.c: Cleanups.
1370 2001-01-28  Andreas Jaeger  <aj@suse.de>
1372         * oldsemaphore.c (__old_sem_init): Adjust for last change.
1373         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1374         * spinlock.c: Likewise.
1376 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
1378         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
1379         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
1380         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
1381         * pthread.c: Likewise.
1382         * spinlock.h: Likewise.
1383         * sysdeps/pthread/pthread.h: Likewise.
1385 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
1387         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
1388         as struct __pthread_attr_s.
1390         * semaphore.h (sem_t): Cleanup namespace, rename status and
1391         spinlock elements.
1393 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
1395         * pthread.c (pthread_onexit_process): Clear
1396         __pthread_manager_thread_bos after freeing it.
1397         * Makefile (tests): Add ex16.
1398         * Examples/ex16.c: New file.
1400 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1402         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
1403         -z nodelete.
1404         * pthread.c (pthread_exit_process): Rename to...
1405         (pthread_onexit_process): ...this.
1406         (pthread_atexit_process, pthread_atexit_retcode): New.
1407         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
1408         and only if HAVE_Z_NODELETE is not defined.
1409         (__pthread_initialize_manager): Register pthread_atexit_retcode
1410         with __cxa_atexit.
1412 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
1414         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
1416 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1418         * Makefile (tests): Add ex15.
1419         * Examples/ex15.c: New test.
1421 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
1423         * pthread.c (pthread_exit_process): Free memory allocated for
1424         manager stack.
1426 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1428         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
1429         (pthread_free): Always unmap the stack.  It's safe now that we don't
1430         use MAP_FIXED to allocate stacks.
1432 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1434         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
1436         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
1438 2000-11-15  Wolfram Gloger  <wg@malloc.de>
1440         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
1441         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
1443 2000-12-27  Andreas Jaeger  <aj@suse.de>
1445         * Examples/ex13.c: Make local functions static.
1446         * ecmutex.c: Likewise.
1447         * joinrace.c: Likewise.
1448         * Examples/ex14.c: Likewise.
1450         * Examples/ex2.c: Make local functions static; reformat.
1451         * Examples/ex1.c: Likewise.
1452         * Examples/ex4.c: Likewise.
1453         * Examples/ex5.c: Likewise.
1454         * Examples/ex7.c: Likewise.
1456         * oldsemaphore.c: Add prototypes to shut up GCC.
1457         * pt-machine.c: Likewise.
1459         * weaks.c: Add prototype for pthread_exit.
1461         * internals.h: Add some prototypes, format prototypes and add
1462         missing externs.
1463         Move __libc_waitpid prototype to include/sys/wait.h.
1465         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
1466         * mutex.c: Likewise.
1467         * specific.c: Likewise.
1468         * ptfork.c: Likewise.
1470         * lockfile.c: Include internals.h to get prototypes.
1471         * events.c: Likewise.
1472         * sysdeps/alpha/pspinlock.c: Likewise.
1473         * sysdeps/arm/pspinlock.c: Likewise.
1474         * sysdeps/hppa/pspinlock.c: Likewise.
1475         * sysdeps/i386/pspinlock.c: Likewise.
1476         * sysdeps/ia64/pspinlock.c: Likewise.
1477         * sysdeps/m68k/pspinlock.c: Likewise.
1478         * sysdeps/mips/pspinlock.c: Likewise.
1479         * sysdeps/powerpc/pspinlock.c: Likewise.
1480         * sysdeps/s390/pspinlock.c: Likewise.
1481         * sysdeps/sh/pspinlock.c: Likewise.
1482         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
1483         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
1484         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
1486 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
1488         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
1489         (__pthread_attr_getstack): Return correct address.
1490         Add warnings for using pthread_attr_getstackaddr and
1491         pthread_attr_setstackaddr.
1493 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
1495         * Examples/ex6.c (test_thread): Make static.
1496         * Examples/ex12.c (test_thread): Make static and add noreturn
1497         attribute.
1499 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
1501         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
1502         and compare_and_swap_with_release_semantics returns int not long.
1504 2000-12-17  Andreas Jaeger  <aj@suse.de>
1506         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
1507         value.
1508         * sysdeps/arm/pt-machine.h (testandset): Likewise.
1509         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
1510         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
1511         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1512         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
1513         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
1515 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
1517         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
1518         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
1520 2000-12-17  Andreas Jaeger  <aj@suse.de>
1522         * internals.h: Add prototypes for testandset and
1523         __compare_and_swap to shut up gcc warnings.
1525 2000-12-06  Wolfram Gloger  <wg@malloc.de>
1527         * join.c (pthread_detach): Allow case where the thread has already
1528         terminated.
1530 2000-12-05  Andreas Jaeger  <aj@suse.de>
1532         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
1533         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1534         (__compare_and_swap): Likewise.
1535         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
1537 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
1539         * Examples/ex3.c (main): Cast int to long before casting to void *.
1540         (search): Cast void * to long, not int.
1541         * Examples/ex8.c (main, thread): Similarly.
1542         * Examples/ex11.c (main): Similarly.
1543         * Examples/ex14.c (worker, do_test): Similarly.
1544         * ecmutex.c (worker, do_test): Similarly.
1545         (nlocks): Cast to int.
1547 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
1549         * linuxthreads.texi:  Add documentation for pthreads attributes
1550         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
1551         patch.  Document pthread_[sg]etconcurrency().  Mark
1552         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
1554 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
1556         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1557         Don't define it.
1558         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1559         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
1561 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
1563         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
1564         not doing it right now.
1565         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
1567 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
1569         * Examples/ex4.c (main): Don't use exit() to avoid warning with
1570         broken compilers.
1572 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
1574         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
1575         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
1577         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
1578         discussing mutexes. (As per the Unix98 name for the API.)
1579         Changes documentation for pthread_mutexattr_setkind_np() and
1580         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
1581         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
1582         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
1583         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
1584         Begins to introduce discussion of the ``timed'' mutex type.  This
1585         discussion is currently incomplete.
1586         Patch by Bruce Mitchener <bruce@cubik.org>.
1588 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
1589             Yutaka Niibe  <gniibe@chroot.org>
1591         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
1592         has restrictions, use register.
1594 2000-10-23  Andreas Schwab  <schwab@suse.de>
1596         * Examples/ex14.c (TIMEOUT): Override default timeout.
1598 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
1600         * specific.c: Protect tsd array modification in thread data
1601         structures by getting the thread lock in pthread_key_delete and
1602         __pthread_destroy_specifics.
1603         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
1605 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1607         * sysdeps/pthread/bits/initspin.h: New file.
1608         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
1609         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
1610         (__pthread_alt_init_lock): Likewise.
1611         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
1613 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
1615         * oldsemaphore.c (__old_sem_init): Release lock with
1616         LT_SPINLOCK_INIT, not zero.
1617         * spinlock.c (__pthread_unlock): Likewise.
1618         (__pthread_alt_lock): Likewise.
1619         (__pthread_alt_timedlock): Likewise.
1620         (__pthread_alt_unlock): Likewise.
1621         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
1622         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
1623         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
1624         LT_SPINLOCK_INIT do initialize spinlocks not 0.
1626 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
1628         * shlib-versions: Add version definitions for hppa-linux.
1630 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1632         * sysdeps/hppa/pspinlock.c: New file.
1633         * sysdeps/hppa/pt-machine.h: New file.
1634         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
1636 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
1638         * mutex.c (__pthread_mutex_destroy): Correct test of
1639         busy mutex for mutexes using alternate fastlocks.
1640         Patch by dtc@cmucl.cons.org.
1642 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
1644         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
1646 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
1648         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
1649         test for owner first.
1650         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1652         * cancel.c (pthread_cancel): Don't do anything if cancelation is
1653         disabled.
1655 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
1657         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
1658         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1660         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
1661         _POSIX_MONOTONIC_CLOCK.
1663         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
1664         and explain why.
1666 2000-09-20  Andreas Jaeger  <aj@suse.de>
1668         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
1669         "testrtsig.h" conditional.
1671 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
1673         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
1674         pthread_attr_setstack.
1675         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
1676         pthread_attr_setstack.
1677         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
1679 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
1681         * Examples/ex14.c: New file.
1682         * Makefile (tests): Add ex14.
1684         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
1685         mutex.  Patch by dtc@cmucl.cons.org.
1687         * ecmutex.c: New file.
1688         * Makefile (tests): Add ecmutex.
1690 2000-09-04  H.J. Lu  <hjl@gnu.org>
1692         * attr.c (__pthread_attr_setguardsize): Use page_roundup
1693         instead of roundup to round up to the page size.
1695 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
1697         * manager.c (pthread_exited): Correctly report event as TD_REAP
1698         instead of TD_DEATH.  Fix comments.
1700 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
1702         * spinlock.h (testandset): Add cast to avoid warning.
1703         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1705 2000-09-02  Andreas Jaeger  <aj@suse.de>
1707         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
1708         prototype.
1710 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
1712         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1713         Fix typo in last patch (_mode -> _flags).
1715         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1716         Provide definition which respects _IO_USER_LOCK flag.
1718 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
1720         * manager.c (pthread_allocate_stack): Clear descriptor only if not
1721         mmaped.
1723 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
1725         * Makefile: Add rules to build and run unload.
1726         * unload.c: New file.
1728         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
1730         * sysdeps/pthread/pthread.h
1731         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
1732         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
1734 2000-08-24  Andreas Jaeger  <aj@suse.de>
1736         * Examples/ex13.c: Include <string.h> for strerror prototype and
1737         <stdlib.h> for abort prototype.
1738         (pthr_cond_signal_mutex): Rewrite to silence GCC.
1739         (thread_start): Remove unused variable err.
1740         (main): Silence GCC warnings.
1742 2000-08-22  Andreas Jaeger  <aj@suse.de>
1744         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
1746         * Makefile (tests): Add ex13.
1748 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
1750         * semaphore.h: Add restrict where required by AGd4.
1751         * sysdeps/pthread/pthread.h: Likewise.
1752         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
1754 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
1756         * Makefile (tests): Add ex12.  Add rule to build it.
1757         * Examples/ex12.c: New file.
1759 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
1761         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
1762         even though the implementation is not quite complete (but it reports
1763         it).  Define _POSIX_MESSAGE_PASSING to -1.
1764         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1766 2000-08-12  Andreas Jaeger  <aj@suse.de>
1768         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
1769         assembler.
1770         (__compare_and_swap): Likewise.
1771         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
1773 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
1775         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
1776         p_h_errnop correctly and not to NULL.
1778 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
1780         * Banner: Bump version number to 0.9.
1782 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
1784         * Makefile (tests): Add tststack.  Add rule to build the program.
1785         * tststack.c: New file.
1787         * internals.h: Declare __pthread_max_stacksize.
1788         * pthread.c (__pthread_max_stacksize): New variable.
1789         (__pthread_initialize_manager): Determine __pthread_initialize_manager
1790         value.
1791         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
1792         (pthread_allocate_stack): Allow kernel to choose stack address if
1793         FLOATING_STACKS.  This also handles variable-sized stacks.
1794         Always allocate stack and guardpage together.  Use mprotect to
1795         change guardpage access.
1796         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
1797         ARCH_STACK_MAX_SIZE.
1799         * attr.c (__pthread_attr_setstacksize): Also test value against
1800         upper limit.
1802         * manager.c (__pthread_nonstandard_stacks): Define only if
1803         THREAD_SELF is not defined.
1804         (pthread_allocate_stack): Always initialize gardaddr to a correct
1805         value.
1806         (pthread_handle_create): Unmap thread with one call.
1807         (pthread_free): Remove test for initial thread before removing stack.
1808         Unmap stack with one call.
1810         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
1811         1 to avoid removing the stack.
1813 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
1815         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
1816         load of spin lock to prime the cache before the atomic compare and
1817         exchange operation (cmpxchg4). This avoids the spinning on the
1818         cmpxchg4 instruction and reduces movement of the cache line back
1819         and forth between the processors (explanation by Asis K. Mallick
1820         from Intel). This basically makes the implementation operate the
1821         same as the Linux kernel implementation.
1823         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
1824         * sysdeps/ia64/pspinlock.c: New file.
1826 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
1828         * pthread.c: Move definition of __pthread_set_own_extricate_if...
1829         * spinlock.h: ...here.  Remove locking.
1830         * internals.h: Remove __pthread_set_own_extricate_if prototype.
1832         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
1833         (rwlock_rd_extricate_func): Don't determine self, let
1834         __pthread_lock do it.
1835         (rwlock_wr_extricate_func): Likewise.
1836         (rwlock_have_already): Optimize *pself handling a bit.
1838         * mutex.c: Use __builtin_expect.
1839         * pthread.c: Likewise.
1841 2000-08-02  Andreas Jaeger  <aj@suse.de>
1843         * sysdeps/s390/pspinlock.c: New file.
1844         * sysdeps/s390/pt-machine.h: New file.
1845         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
1847 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1849         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
1850         R3K.
1851         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1853 2000-07-26  Andreas Jaeger  <aj@suse.de>
1855         * pthread.c: Initialize p_sem_avail.
1857 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
1859         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
1860         * semaphore.c: Handle spurious wakeups.
1862         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
1863         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
1865         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
1866         (__pthread_wait_for_restart): Likewise.
1868         * condvar.c (pthread_cond_wait): Also check whether thread is
1869         cancelable before aborting loop.
1870         (pthread_cond_timedwait): Likewise.
1872         * signals.c (pthread_sighandler): Remove special code to restrore
1873         %gs on x86.
1874         (pthread_sighandler_t): Likewise.
1876 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
1878         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
1879         * pthread.c: Include <resolv.h>.
1880         (_res): Undefine.  Add extern declaration.
1882 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
1884         * pthread.c (__pthread_initial_thread): Update initializer.
1885         (__pthread_manager_thread): Likewise.
1886         (pthread_initialize): Move setrlimit call to...
1887         (__pthread_initialize_manager): ...here.
1888         (__pthread_reset_main_thread): Reset also soft limit on stack size.
1890         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
1891         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
1893 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
1895         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
1896         __compare_and_swap to define testandset.
1897         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
1898         Define IMPLEMENT_TAS_WITH_CAS.
1900 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
1902         * Makefile: Pass -z nodelete to linker for libpthread.so
1903         generation if it understand this option.
1905 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
1907         * manager.c (pthread_handle_create): Remove initialization of
1908         new_thread->p_res._sock.
1910 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
1912         Bugfixes to the variant of the code for machines with no compare
1913         and swap.
1915         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
1916         node was not being properly enqueued, due to failing to update
1917         the lock->__status field.
1919         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
1920         being set inappropriately, causing the suspend function to be called
1921         with a null self pointer and crash.
1923 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
1925         * spinlock.h (__pthread_alt_trylock): Fix code used if no
1926         compare&swap is available.
1928         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
1929         compare_and_swap.
1931         * pthread.c (pthread_initialize): Don't use sysconf to determine
1932         whether the machine has more than one processor.
1934         * spinlock.c (__pthread_alt_timedlock): Add back one of the
1935         removed thread_self calls.
1937 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1939         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
1940         __compare_and_swap to compare_and_swap in code which assumes
1941         compare swap is available.
1943 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1945         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
1946         bug whereby thr field of waitnode structure would not be correctly
1947         set unless a null self pointer is passed to the functions.
1948         Eliminated redundant calls to thread_self().
1950 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
1952         * pthread.c (__pthread_initialize_manager): Lock
1953         __pthread_manager_thread.p_lock before calling clone.
1955 2000-05-05  H.J. Lu  <hjl@gnu.org>
1957         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1958         have acquire semantics.
1959         (__compare_and_swap_with_release_semantics): New inline
1960         function.
1961         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1963 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
1965         * manager.c: Fix the problem with signals at startup.
1966         Change the way that thread stacks are allocated on IA64.
1967         Clean up some of the guard page allocation stuff.
1969 1999-12-19  H.J. Lu  <hjl@gnu.org>
1971         * internals.h (page_roundup): New.
1972         * attr.c (__pthread_attr_setguardsize); Use page_roundup
1973         instead of roundup.
1974         * manager.c (pthread_allocate_stack): Make sure guardaddr is
1975         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1976         is define.
1978 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
1980         * manager.c (pthread_allocate_stack): Unmap the stack top
1981         if failed to map the stack bottom.
1982         Fix the guard page.
1983         (pthread_free): Fix the guard page.
1985         * pthread.c (pthread_initialize): Set rlimit correctly for
1986         NEED_SEPARATE_REGISTER_STACK.
1988 1999-12-16  H.J. Lu  <hjl@gnu.org>
1990         * pthread.c (__pthread_initialize_manager): Pass
1991         __pthread_manager_thread_bos instead of
1992         __pthread_manager_thread_tos to __clone2.
1994 1999-12-16  H.J. Lu  <hjl@gnu.org>
1996         * manager.c (pthread_allocate_stack): Correct the calculation
1997         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1998         stack bottom.
2000 1999-12-13  H.J. Lu  <hjl@gnu.org>
2002         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
2003         bit after setting ar.ccv.
2005 1999-12-12  H.J. Lu  <hjl@gnu.org>
2007         * manager.c (pthread_allocate_stack): Make the starting
2008         address of the stack bottom page aligned. FIXME: it may
2009         need changes in other places.
2010         (pthread_handle_create): Likewise.
2012 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
2014         * manager.c (pthread_allocate_stack): Handle
2015         NEED_SEPARATE_REGISTER_STACK.
2016         (pthread_handle_create): Likewise.
2017         * pthread.c (__pthread_initialize_manager): Likewise.
2019         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
2021 1999-12-02  H.J. Lu  <hjl@gnu.org>
2023         * sysdeps/ia64/pt-machine.h: New.
2025 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
2027         * wrapsyscall.c: Mark non-__ protected names as weak.
2028         PR libc/1466.
2030 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
2032         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
2034 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
2036         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
2037         Add tests also to new alternative spinlock implementation.
2038         * spinlock.h: Likewise.
2039         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2041 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
2043         * Version: Export __sigaction.
2044         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
2045         of __sigaction.
2046         * pthread.c: Use __libc_sigaction instead of __sigaction.
2048         * condvar.c: Implement pthread_condattr_getpshared and
2049         pthread_condattr_setpshared.
2050         * mutex.c: Implement pthread_mutexattr_getpshared and
2051          pthread_mutexattr_setpshared.
2052         * Versions: Export new functions.
2053         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2055         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
2056         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
2057         is not selected.
2059 2000-07-04  Greg McGary  <greg@mcgary.org>
2061         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
2062         pragmas.  Include bp-sym.h only if _LIBC.
2064 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
2066         * spinlock.c (__pthread_unlock): Properly place write barrier.
2067         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2069 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
2071         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
2072         faster on SMP systems.  No more emulation of compare&swap for adaptive
2073         spinlocks.
2074         * spinlock.h: Likewise.
2075         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
2076         Replace fast with adaptive mutex.
2077         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
2078         * condvar.c: Likewise.
2079         * pthread.c: Define and initialize __pthread_smp_kernel variable.
2080         * internals.h: Declare __pthread_smp_kernel.
2081         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
2082         _pthread_fastlock structure.
2083         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2085         * pthread.c: Remove initialization to zero from global variables.
2087 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
2089         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
2091 2000-06-28  Greg McGary  <greg@mcgary.org>
2093         * weaks.c: Wrap BP_SYM () around weak extern declarations of
2094         pthread functions that have pointers in their return+arg signatures.
2096 2000-06-27  Greg McGary  <greg@mcgary.org>
2098         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
2099         extern declarations of pthread functions that have pointers in
2100         their return+arg signatures.
2102 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
2104         * Makefile (tests): Add ex11.  Add rules to build it.
2105         * Examples/ex11.c: New file.
2106         * rwlock.c: Fix complete braindamaged previous try to implement
2107         timedout functions.
2109         * spinlock.c: Pretty print.
2111 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
2113         * Makefile (tests): Add ex10.  Add rules to build it.
2114         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
2115         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
2116         * condvar.c (pthread_cond_wait): Allow mutex of kind
2117         PTHREAD_MUTEX_TIMED_NP.
2118         (pthread_cond_timedwait_relative): Likewise.
2119         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
2120         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
2121         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2122         (__pthread_mutex_lock): Use __pthread_alt_lock for
2123         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2124         (__pthread_mutex_timedlock): New function.
2125         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
2126         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
2127         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
2128         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
2129         * spinlock.c: Implement alternate fastlocks.
2130         * spinlock.h: Add prototypes.
2131         * Examples/ex10.c: New file.
2132         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2133         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2135         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
2136         (__pthread_rwlock_timedrdlock): New function.
2137         (__pthread_rwlock_timedwrlock): New function.
2138         Use laternate fastlock function everywhere.
2140 2000-06-21  Andreas Jaeger  <aj@suse.de>
2142         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
2143         prototype.
2145         * join.c: Include <stdlib.h> for exit prototype.
2147 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
2149         * sysdeps/i386/useldt.h: Include <stdlib.h>.
2151         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
2152         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2154         * Makefile (libpthread-routines): Add barrier.
2155         (tests): Add ex9.  Add rule to build ex9.
2156         * Versions: Export barrier functions.
2157         * barrier.c: New file.
2158         * Examples/ex9.c: New file.
2159         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
2160         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
2161         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2163 2000-06-19  H.J. Lu  <hjl@gnu.org>
2165         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
2166         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
2167         (compare_and_swap_with_release_semantics): New. Default to
2168         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
2169         is not defined.
2171         * spinlock.c (__pthread_unlock): Call
2172         compare_and_swap_with_release_semantics () instead of
2173         compare_and_swap ().
2175 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
2177         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
2178         to errno directly.
2179         * sysdeps/pthread/timer_delete.c: Likewise.
2180         * sysdeps/pthread/timer_getoverr.c: Likewise.
2181         * sysdeps/pthread/timer_gettime.c: Likewise.
2182         * sysdeps/pthread/timer_settime.c: Likewise.
2184 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2186         Timer nodes are now reference counted, and can be marked
2187         as deleted. This allows for the safe release of the global mutex
2188         in the middle without losing the timer being operated on.
2190         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
2191         member is now an enum with three values, so that an intermediate
2192         state can be represented (deleted but not free for reuse yet).
2193         New refcount member added.
2194         * sysdeps/pthread/timer_routines.c: Likewise.
2196         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
2197         timer_valid): New inline functions added.
2199         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
2200         restructured, recursive deadlock bug fixed.
2202         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
2203         timer_addref to ensure that timer won't be deleted while mutex is not
2204         held. Also uses timer_invalid to perform validation of timer handle.
2205         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
2206         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
2208 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
2210         * shlib-versions: Add entry for SH.
2211         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
2213 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
2215         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
2216         tightened up some critical regions and micro-optimized some list
2217         manipulation code.
2219         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2220         Returns int value now to indicate whether timer was queued at head.
2221         * sysdeps/pthread/posix-timer.h: Likewise.
2222         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
2223         new return value from __timer_thread_queue_timer to avoid waking
2224         up timer thread unnecessarily.
2226         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
2227         inuse flag, because this requires mutex to be held.  Callers updated
2228         to do the check when they have the mutex.
2229         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
2231         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
2232         regions: avoids making system calls while holding timer mutex, and
2233         a few computations were moved outside of the mutex as well.
2234         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
2236         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
2237         to list_unlink_ip, meaning idempotent.  Pointer manipulation
2238         changed to get better better code out of gcc.
2239         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
2240         version of list_unlink added here.
2241         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
2242         function in all places: idempotent one for timers, non-idempotent
2243         one for thread nodes.
2244         * sysdeps/pthread/timer_settime: Likewise.
2245         * sysdeps/pthread/timer_routines.c: Likewise.
2247 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
2249         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
2250         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2252         * sysdeps/pthread/Makefile: Remove tests definition.
2254 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
2255             Yutaka Niibe  <gniibe@chroot.org>
2257         * sysdeps/sh/pspinlock.c: New file.
2258         * sysdeps/sh/pt-machine.h: New file.
2260 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
2262         * Makefile (tests): Add joinrace.
2264         * Examples/ex6.c: Test return value of pthread_join.
2266 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
2268         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
2269         (__pthread_spin_trylock): Implement.
2270         (__pthread_spin_unlock): Implement.
2271         (__pthread_spin_init): Implement.
2272         (__pthread_spin_destroy): Implement.
2274 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2276         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
2277         really append the entry.
2279 2000-06-10  Andreas Jaeger  <aj@suse.de>
2281         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
2283 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
2285         * sysdeps/pthread/timer_create.c: Thread matching now done on
2286         clock type as well as thread attributes.
2287         There are individual global signal-delivering threads for
2288         different clock types.
2289         * sysdeps/pthread/posix-timer.h: Likewise.
2290         * sysdeps/pthread/timer_routines.c: Likewise.
2292         * sysdeps/pthread/timer_routines.c: Thread allocation and
2293         deallocation function now remembers to put thread on active
2294         list and remove from active list.
2295         Thus now the feature of binding multiple timers
2296         to a single thread actually works.
2298 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2300         * pthread.c (__pthread_create_2_1): Optimize a bit.
2302         * internals.h (invalid_handle): Also test for p_terminated != 0.
2303         (nonexisting_handle): New function.  Same as old invalid_handle.
2304         * join.c (pthread_join): Use nonexisting_handle instead of
2305         invalid_handle to test for acceptable thread handle.
2306         * manager.c (pthread_handle_free): Likewise.
2307         * joinrace.c: New file.
2308         Reported by Permaine Cheung <pcheung@cygnus.com>.
2310 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2312         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2313         Correct handling of matching variable.
2315         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
2316         avoid warnings.
2318         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2319         Be prepared for empty timer list.
2321         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
2322         CPUTIME clock ID.  Add support for thread clocks.
2324         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
2325         subtraction were switched.
2327         * sysdeps/pthread/timer_routines.c (init_module): Use
2328         THREAD_MAXNODES threads.
2330         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
2331         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
2332         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
2333         with sigqueueinfo is this system call is available.
2335         * sysdeps/pthread/timer_create.c (timer_create): Allow
2336         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
2338         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
2339         functionality.
2340         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
2342 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2344         * sysdeps/pthread/posix-timer.h: New file.
2345         * sysdeps/pthread/timer_create.c: New file.
2346         * sysdeps/pthread/timer_delete.c: New file.
2347         * sysdeps/pthread/timer_getoverr.c: New file.
2348         * sysdeps/pthread/timer_gettime.c: New file.
2349         * sysdeps/pthread/timer_routines.c: New file.
2350         * sysdeps/pthread/timer_settime.c: New file.
2351         * sysdeps/pthread/tst-timer.c: New file.
2353 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2355         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
2356         LINK_MAX definitions if necessary.
2358 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2360         Added missing fork time handling of global libio lock.
2362         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
2363         not just the individual stream locks. Rewritten to use new
2364         iterator interface provided by libio rather than accessing
2365         global variable.
2367         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
2368         which lock and unlock the stream list using the new interface
2369         provied by libio.
2370         * internals.h: Likewise.
2372         * ptfork.c (__fork): Now calls __flockfilelist before fork,
2373         and __funlockfilelist in the parent after the fork.
2374         Child still calls __fresetlockfiles as before.
2376         * linuxthreads.texi: Now explains what happens to streams at
2377         fork time. Also whole new section on forking and thread added.
2378         Definition of pthread_atfork moved out of Miscellaneous Functions
2379         to this new section.
2381 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
2383         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
2384         Add missing register.
2385         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
2387 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
2389         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
2390         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
2391         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
2393 2000-05-31  Andreas Jaeger  <aj@suse.de>
2395         * sysdeps/mips/pspinlock.c: Implement spinlocks.
2397 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
2399         * spinlock.c (__pthread_lock): Remove ASSERT.
2401         * Makefile (tests): Add ex8.
2402         * Examples/ex8.c: New file.
2404 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
2406         Bugfix: The pthread_atfork mechanism now takes care of its
2407         own internal mutex at fork time.
2409         * ptfork.c (__fork): Revised so that the mutex is held across
2410         the fork operation and while the handlers are called, and so that
2411         the child resets the mutex.
2413         * linuxthreads.texi: Updated pthread_atfork documentation to make
2414         it clear that fork and pthread_atfork can't be reentered from
2415         atfork handlers, that pthread_atfork and fork are mutually atomic,
2416         and that the handlers are inherited by the child process.
2418 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
2420         * Makefile (libpthread-routines): Add pspinlock.
2421         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
2422         Use struct _pthread_fastlock instead of pthread_spinlock_t.
2423         * condvar.c: Likewise.
2424         * internals.h: Likewise.
2425         * join.c: Likewise.
2426         * manager.c: Likewise.
2427         * mutex.c: Likewise.
2428         * pthread.c: Likewise.
2429         * rwlock.c: Likewise.
2430         * semaphore.c: Likewise.
2431         * signals.c: Likewise.
2432         * spinlock.h: Likewise.
2433         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
2434         * sysdeps/alpha/pspinlock.c: New file.
2435         * sysdeps/arm/pspinlock.c: New file.
2436         * sysdeps/i386/pspinlock.c: New file.
2437         * sysdeps/m68k/pspinlock.c: New file.
2438         * sysdeps/mips/pspinlock.c: New file.
2439         * sysdeps/powerpc/pspinlock.c: New file.
2440         * sysdeps/sparc/sparc32/pspinlock.c: New file.
2441         * sysdeps/sparc/sparc64/pspinlock.c: New file.
2442         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
2443         back to _pthread_fastlock.  Define new pthread_spinlock_t.
2445 2000-05-24  Andreas Jaeger  <aj@suse.de>
2447         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
2449 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
2451         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
2453 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
2455         * internals.h (__RES_PTHREAD_INTERNAL): Define.
2457 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2459         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
2460         object state is represented with additional bits which distinguish
2461         whether that state was set up in the current process, or
2462         in an ancestor process. If that state was set in an ancestor,
2463         it means that a fork happened while thread was executing the init
2464         function. In that case, the state is reset to NEVER.
2465         * mutex.c (__pthread_once_fork_prepare): New function.
2466         (__pthread_once_fork_child): Likewise
2467         (__pthread_once_fork_parent): Likewise
2468         (__pthread_reset_pthread_once): Removed.
2469         * ptfork.c (__fork): Call new handlers in mutex.c.
2470         * internals.h: Declarations of new mutex.c functions added.
2471         Declaration of removed function deleted.
2472         * linuxthreads.texi: Updated documentation about pthread_once
2473         to clarify what happens under cancellation and forking.
2475 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2477         * internals.h: New thread manager request type, REQ_KICK.
2478         * join.c (pthread_exit): main thread now calls exit() instead
2479         of _exit() in order to proper process cleanup.
2480         * manager.c (__pthread_manager): Do not terminate manager
2481         after unblocking main thread; wait for main thread's
2482         REQ_PROCESS_EXIT request instead.
2483         Also, added REQ_KICK case to handle new request; this just does
2484         nothing.
2485         * manager.c (pthread_exited): Do not terminate manager after
2486         unblocking main thread.
2487         * manager.c (__pthread_manager_sighandler): If the main thread
2488         is waiting for all other threads to die, send a REQ_KICK into
2489         the thread manager request pipe to get it to clean out the threads
2490         and unblock the main thread as soon as possible. This fixes
2491         the 2000 millisecond hang on shutdown bug.
2492         * Examples/ex7.c: New file, tests shutdown behavior when all threads
2493         including the main one call pthread_exit(), or implicitly do so.
2494         * Makefile (tests): Add ex7.
2496 2000-05-05  Andreas Jaeger  <aj@suse.de>
2498         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2499         (pthread_getcpuclockid): Correct test for ourselves.
2501 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
2503         * internals.h (struct _pthread_descr_struct): Reorganization.
2504         Allocate room for 16 pointers at head of the structure for future
2505         thread-local data handling.  Move p_self member in this area.
2506         * manager.c (pthread_handle_create): Adjust use of p_self.
2507         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
2508         * pthread.c (__pthread_initial_thread): Adjust initialization.
2509         (__pthread_manager_thread): Likewise.
2511 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
2513         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
2514         for eventmask larger than 1 word.
2516 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
2518         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
2519         * pthread.c (__pthread_initialize_minimal): New function.  Perform
2520         minimal initialization.
2521         (pthread_initialize): Remove this code here.
2522         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
2523         are working around the problem in glibc.
2525 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
2527         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
2528         now.  First gcc must be fixed (more concrete: libgcc).
2530 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
2532         * pthread.c: Remove special treatement for interrupt handlers on x86.
2533         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
2534         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
2535         necessary.
2536         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
2538 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
2540         * join.c (pthread_exit): Set p_terminated after reporting the
2541         termination event instead of before.
2543 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
2545         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
2546         if __USE_UNIX98.
2548 2000-04-18  Andreas Jaeger  <aj@suse.de>
2550         * Versions: Use ld instead of ld.so.
2552 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2554         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
2555         Remove the typedef keyword.
2557 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2559         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
2560         not stbar.
2561         (READ_MEMORY_BARRIER): Define.
2562         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
2563         MEMORY_BARRIER.
2564         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
2565         headers.
2567 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
2569         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2570         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
2571         use thread_handle().
2573 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
2575         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
2576         if fast mutex is used.  Don't initialize `already_canceled' twice.
2577         Correctly test for return value of timedsuspend.
2579         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
2580         therefore don't need the _rt versions of the signal handlers.
2582 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2584         * pthread.c (pthread_yield): New function.
2585         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
2586         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
2587         * internals.h: Declare __pthread_yield.
2589         * pthread.c (pthread_initialize): Avoid a bit more code if
2590         realtime signals are known to exist.
2592         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
2593         to dynamically detect RT signals and avoid generating compatibility
2594         functions with old kernel.
2595         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
2596         __pthread_restart_new directly.
2597         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
2598         __pthread_wait_for_restart_signal directly.
2599         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
2600         __pthread_timedsuspend_new directly.
2602 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2604         * condvar.c: Remove all the special code to handle cond_timedwait.
2605         Use timedsuspend instead.
2606         * internals.h: Declare __pthread_timedsuspend_old,
2607         __pthread_timedsuspend_new, and __pthread_timedsuspend.
2608         Remove declaration of __pthread_init_condvar.
2609         * pthread.c: Define __pthread_timedsuspend variable.
2610         (__pthread_timedsuspend_old): New function.  Timed suspension
2611         implementation for old Linux kernels.
2612         (__pthread_timedsuspend_new): New function.  Timed suspension
2613         implementation for new Linux kernels.
2614         * restart.h (timedsuspend): New function.  Call appropriate
2615         suspension function through __pthread_timedsuspend.
2616         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
2617         the code.
2618         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2620         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
2621         undefined.
2622         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
2623         where possible.
2624         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
2625         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2627         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
2628         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2630 2000-04-14  Andreas Jaeger  <aj@suse.de>
2632         * weaks.c: Fix typo.
2634         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
2635         2.2 for linuxthreads.
2637 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
2639         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2640         (pthread_getcpuclockid): Fix typo.
2642 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
2644         * Makefile (libpthread-routines): Add getcpuclockid.
2645         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
2646         * sysdeps/pthread/getcpuclockid.c: New file.
2647         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
2648         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
2650         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
2651         Defined.
2652         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2654         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
2655         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2656         and pthread_spin_unlock.
2657         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
2658         into pthread_spinlock_t.  Change all uses.
2659         * spinlock.c: Implement pthread_spin_lock.
2660         Rename __pthread_unlock to __pthread_spin_unlock and define weak
2661         alias for real name.
2662         Define pthread_spin_trylock, pthread_spin_init, and
2663         pthread_spin_destroy.
2664         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2665         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
2666         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2667         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
2668         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2669         and pthread_spin_unlock.
2670         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
2671         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2672         * condvar.c: Likewise.
2673         * internals.h: Likewise.
2674         * join.c: Likewise.
2675         * manager.c: Likewise.
2676         * mutex.c: Likewise.
2677         * pthread.c: Likewise.
2678         * rwlock.c: Likewise.
2679         * semaphore.c: Likewise.
2680         * signals.c: Likewise.
2682         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
2683         macros.
2684         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
2686 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2688         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
2689         _POSIX_SHARED_MEMORY_OBJECTS.
2691 2000-04-11  Andreas Jaeger  <aj@suse.de>
2693         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
2694         (__compare_and_swap): Mark as modifying memory.
2696 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
2698         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
2699         __volatile__.
2700         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
2701         Don't have the 'asm' __volatile__.
2703 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2705         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
2706         * spinlock.c (__pthread_lock): Add memory barriers.
2707         (__pthread_unlock): Likewise.
2708         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
2709         instruction.
2710         (RELEASE): Not needed anymore.
2711         (__compare_and_swap): Mark asm as modifying memory.
2712         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
2713         of MEMORY_BARRIER.
2714         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
2715         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
2716         (MEMORY_BARRIER): Define using stbar.
2717         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
2718         stbar.
2719         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
2720         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
2721         Mike Burrows <m3b@pa.dec.com>.
2723 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
2725         * signals.c (sigaction): Fix return value for the case SIG is one
2726         of the signals the implementation uses.
2727         Patch by Xavier.Leroy@inria.fr.
2729 2000-04-01  Andreas Jaeger  <aj@suse.de>
2731         * attr.c: Use shlib-compat macros.
2732         * oldsemaphore.c: Likewise.
2733         * pthread.c: Likewise.
2734         * weaks.c: Likewise.
2736 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
2738         * semaphore.c (sem_timedwait): New function.
2739         Patch by Carl Mailloux <carlm@oricom.ca>.
2740         * semaphore.h: Declare sem_timedwait.
2741         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
2743 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
2745         * sysdeps/pthread/Makefile: File removed.
2747 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
2749         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
2750         * internals.h (__pthread_reset_pthread_once): Add prototype.
2751         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
2753         * manager.c (pthread_handle_create): Store ID of new thread before
2754         clone call.
2756 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
2758         * attr.c: Use new macros from shlib-compat.h to define versions.
2759         * oldsemaphore.c: Likewise.
2760         * semaphore.c: Likewise.
2761         * weaks.c: Likewise.
2763         * pthread.c: Update for new SHLIB_COMPAT definition.
2765         * manager.c (__pthread_manager): Unmask debug signal.
2767         * pthread.c (pthread_initialize): Test for address of __dso_handle
2768         being NULL, not value.  Use __on_exit, not on_exit.
2769         Patch by Andreas Jaeger <aj@suse.de>.
2771         * pthread.c: Use new macros from shlib-compat.h to define versions.
2773 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
2775         * pthread.c (pthread_initialize): Instead of on_exit use
2776         __cxa_atexit if __dso_label is available to allow unloading the
2777         libpthread shared library.
2779 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
2781         * condvar.c: Make tests for ownership of mutex less strict.
2783 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
2785         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
2786         current thread and return error if not.
2787         (pthread_cond_timedwait_relative_old): Likewise.
2788         (pthread_cond_timedwait_relative_new): Likewise.
2790         * mutex.c (__pthread_once): Handle cancelled init function correctly.
2791         (pthread_once_cancelhandler): New function.
2792         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2794 2000-03-14  Andreas Jaeger  <aj@suse.de>
2796         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
2797         REG_GS.
2798         (pthread_handle_sigrestart_rt): Likewise.
2799         * signals.c (pthread_sighandler_rt): Likewise.
2801 2000-03-02  Andreas Jaeger  <aj@suse.de>
2803         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
2804         Reported by Sean Chen <sean.chen@turbolinux.com>.
2806 2000-02-28  Andreas Jaeger  <aj@suse.de>
2808         * rwlock.c: Fix typo.
2810 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
2812         * rwlock.c: Define __* variants of the functions and make old names
2813         aliases.
2814         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
2815         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
2817 2000-02-25  Andreas Jaeger  <aj@suse.de>
2819         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2820         pwrite64, lseek64, open64, and __open64 with version 2.2.
2822 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
2824         * semaphore.h (SEM_FAILED): Use 0 not NULL.
2826 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
2828         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
2829         nanosleep does not work either.  Get absolute time inside the
2830         loop.
2831         (pthread_cond_timedwait_relative_new): Likewise.
2832         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2834 2000-02-13  Andreas Jaeger  <aj@suse.de>
2836         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
2837         (pthread_cond_timedwait_relative_old): Likewise.
2839 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
2841         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
2842         but keep the code around.  A bug in the kernel prevent us from
2843         using the code.
2844         (pthread_cond_timedwait_relative_new): Likewise.
2845         (PR libc/1597 and libc/1598).
2847 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
2849         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
2850         loop around nanosleep calls instead of around most of the function
2851         (pthread_cond_timedwait_relative_new): Likewise.
2852         body.  Got rid of backwards goto and one local.
2854 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
2856         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
2857         before every nanosleep call to account for time spent in the rest
2858         of the function.
2859         (pthread_cond_timedwait_relative_new): Likewise.
2860         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
2862 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
2864         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
2865         from nanosleep call so that in case we restart we only wait for the
2866         remaining time.
2867         (pthread_cond_timedwait_relative_new): Likewise.
2868         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
2870 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
2872         * manager.c (pthread_allocate_stack): Compute guard page address
2873         correctly.  Patch by HJ Lu.
2875         * sysdeps/pthread/pthread.h: Define
2876         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
2878 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
2880         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
2881         preference handling.
2882         (pthread_rwlockattr_setkind_np): Allow
2883         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
2884         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2886 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
2888         * internals.h (pthread_readlock_info): New structure.
2889         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
2890         p_untracked_readlock_count.
2891         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2892         Add initializers for new fields.
2893         * manager.c (pthread_free): Free read/write lock lists.
2894         * queue.h (queue_is_empty): New function.
2895         * rwlock.c: Implement requirements about when readers should get
2896         locks assigned.
2897         * sysdeps/pthread/pthread.h
2898         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
2899         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
2900         Define this name as well.
2901         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2903 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
2905         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2906         Adjust initializers for struct _pthread_descr_struct change.
2907         * internals.h (struct _pthread_descr_struct): Move new elements to
2908         the end.
2910 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
2912         Redesigned how cancellation unblocks a thread from internal
2913         cancellation points (sem_wait, pthread_join,
2914         pthread_cond_{wait,timedwait}).
2915         Cancellation won't eat a signal in any of these functions
2916         (*required* by POSIX and Single Unix Spec!).
2917         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
2918         simultaneous condition variable signal (not required by POSIX
2919         or Single Unix Spec, but nice).
2920         * spinlock.c: __pthread_lock queues back any received restarts
2921         that don't belong to it instead of assuming ownership of lock
2922         upon any restart; fastlock can no longer be acquired by two threads
2923         simultaneously.
2924         * restart.h: Restarts queue even on kernels that don't have
2925         queued real time signals (2.0, early 2.1), thanks to atomic counter,
2926         avoiding a rare race condition in pthread_cond_timedwait.
2928 1999-12-31  Andreas Jaeger  <aj@suse.de>
2930         * internals.h: Remove duplicate prototype declarations.
2932         * weaks.c: Remove __THROW from prototypes since the file is not
2933         compiled by a C++ compiler.
2934         * internals.h: Likewise.
2936 1999-12-30  Andreas Jaeger  <aj@suse.de>
2938         * sysdeps/pthread/pthread.h: Move internal functions to...
2939         * sysdeps/pthread/bits/libc-lock.h: ...here.
2941 1999-12-29  Andreas Jaeger  <aj@suse.de>
2943         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
2945 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
2947         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
2948         beginning.
2950         * manager.c (__pthread_start): Add one more cast to prevent
2951         warning on 64bit machines.
2953 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
2955         * manager.c (pthread_handle_create): Set p_pid of new thread
2956         before calling the callback function to report a new thread.
2958 1999-12-20  Andreas Jaeger  <aj@suse.de>
2960         * pthread.c (pthread_initialize): Move getrlimit call after
2961         setting of errno.
2963 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
2965         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2966         pwrite64, lseek64, open64, and __open64.
2967         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2968         pwrite64, lseek64, open64, and __open64.
2970         * manager.c (pthread_allocate_stack): Correct computation of
2971         new_thread_bottom.  Correct handling of stack size and when the
2972         rlimit method to guard for stack growth is used.
2973         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2974         minus one pagesize (not two).
2976 1999-12-03  Andreas Jaeger  <aj@suse.de>
2978         * Versions: Add __res_state with version GLIBC_2.2.
2980         * errno.c (__res_state): New function to return thread specific
2981         resolver state.
2983         * pthread.c (pthread_initialize): Initialize p_resp.
2984         (__pthread_reset_main_thread): Also set p_resp.
2986         * manager.c (pthread_handle_create): Initialize p_resp.
2988         * internals.h: Add thread specific resolver state.
2989         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2991 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
2993         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2994         beginning.
2995         * sysdeps/i386/i686/pt-machine.h: Likewise.
2996         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2998 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
3000         * manager.c (pthread_start_thread_event): Initialize p_pid already
3001         here.
3003 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
3005         * internals.h: Add prototype for __pthread_manager_event.
3006         * manager.c (__pthread_manager_event): New function.
3007         (pthread_start_thread_event): Correct computation of self.
3008         Use INIT_THREAD_SELF.
3009         * pthread.c (__pthread_manager_thread): Initialize p_lock.
3010         (__pthread_initialize_manager): Respect event flags also for creation
3011         of the manager thread.
3013 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
3015         * pthread.c (__pthread_initialize_manager): Initialize
3016         __pthread_manager_thread.p_tid.
3018 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
3020         * internals.h: Declare __pthread_last_event.
3021         * manager.c: Define __pthread_last_event.
3022         (pthread_handle_create): Set __pthread_last_event.
3023         (pthread_exited): Likewise.
3024         * join.c (pthread_exit): Likewise.
3026         * Makefile (libpthread-routines): Add events.
3027         * events.c: New file.
3028         * internals.h: Protect against multiple inclusion.
3029         Include thread_dbP.h header.
3030         (struct _pthread_descr_struct): Add new fields p_report_events and
3031         p_eventbuf.
3032         Declare event reporting functions.
3033         * join.c (pthread_exit): Signal event if this is wanted.
3034         * manager.c (__pthread_threads_events): New variable.
3035         (pthread_handle_create): Take new parameters with event information.
3036         Signal TD_CREATE event if wanted.
3037         (__pthread_manager): Adjust pthread_handle_create call.
3038         (pthread_start_thread_event): New function.  Block until manager is
3039         finished and then call pthread_start_thread.
3040         (pthread_exited): Signal TD_REAP event if wanted.
3042 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
3044         * restart.h (suspend_with_cancellation): Rewrite as a macro.
3046         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
3048 1999-10-25  Andreas Jaeger  <aj@suse.de>
3050         * internals.h: Remove K&R compatibility.
3051         * no-tsd.c: Likewise.
3052         * semaphore.h: Likewise.
3053         * signals.c: Likewise.
3054         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
3055         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
3056         * weaks.c: Likewise.
3058 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
3060         * pthread.c: For i386, wrap pthread_handle_sigrestart and
3061         pthread_handle_sigcancel with functions that restore %gs from the
3062         signal context.  For each signal handling function, two wrappers
3063         are required, one for a non-RT signal and one for a RT signal.
3064         * signal.c: For i386, add code to restore %gs from the signal
3065         context in pthread_sighandler and pthread_sighandler_rt.
3067 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
3069         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
3071 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
3073         * pthread.c (__pthread_initial_thread): Pass argument to
3074         PTHREAD_START_ARGS_INITIALIZER.
3075         (__pthread_manager_thread): Likewise.
3077         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
3078         initialize function.
3080         * manager.c (pthread_handle_create): Remove p_startfct initialization.
3082         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
3084 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
3086         * internals.h: Correct return types for __libc_read and __libc_write.
3088 1999-10-09  Andreas Jaeger  <aj@suse.de>
3090         * internals.h: Add __new_sem_post to get prototype in
3091         manager.c; include semaphore.h for needed types.
3093 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
3095         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
3096         directly instead of calling sem_post which should not be necessary
3097         but is faster and might help in some case to work around problems.
3098         Patch by khendricks@ivey.uwo.ca [libc/1382].
3100 1999-10-08  Andreas Schwab  <schwab@suse.de>
3102         * sysdeps/pthread/Subdirs: New file.
3103         * Implies: Removed.
3105 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
3107         * Implies: New file.
3108         * internals.h (struct _pthread_descr_struct): Add p_startfct.
3109         * manager.c (pthread_handle_create): Initialize p_startfct.
3110         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
3112 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
3114         * manager.c (__linuxthreads_pthread_threads_max): New variable.
3115         * specific.c (__linuxthreads_pthread_keys_max): New variable.
3116         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
3118         * condvar.c (pthread_cond_timedwait_relative): Never return with
3119         EINTR.  Patch by Andreas Schwab.
3121 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
3123         * signals.c (sigaction): Correct last patch.  Don't select
3124         pthread_sighandler_rt based on the signal number but instead of
3125         the SA_SIGINFO flag.
3127 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
3129         * specific.c: Move definitions of struct pthread_key_struct and
3130         destr_function to ...
3131         * internals.h: ...here.
3133 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
3135         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
3136         this instead of pthread_handle_sigrestart if the signal is an RT
3137         signal.
3139         * signals.c: Handle passing through of sighandler arguments also
3140         for real-time signals.
3142 1999-09-03  Andreas Schwab  <schwab@suse.de>
3144         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
3145         fork as weak alias.
3146         (__vfork): New function, alias vfork.
3147         * Versions: Export __fork, vfork, and __vfork in libpthread.
3149 1999-08-23  Andreas Schwab  <schwab@suse.de>
3151         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
3152         call to signal handler.
3154 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
3156         * pthread.c (__pthread_reset_main_thread): Undo last change.
3157         (__pthread_kill_other_threads_np): Reset signal handlers for the
3158         signals we used in the thread implementation here.
3160 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
3162         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
3163         for the signals we used in the thread implementation [PR libc/1234].
3165         * Versions: Export __pthread_kill_other_threads_np from libpthread
3166         for GLIBC_2.1.2.
3168         * signals.c: Pass sigcontext through wrapper to the user function.
3170 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
3172         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
3173         __libc_internal_tsd_set.
3175 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3177         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
3178         needed anymore.
3180 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3182         * internals.h: Align _pthread_descr_struct to 32 bytes.
3183         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
3184         libc/1206.
3186 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3188         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
3189         swap function.
3191 1999-07-09  Cristian Gafton  <gafton@redhat.com>
3193         * Makefile (libpthread-routines): Add oldsemaphore routine.
3194         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
3195         sem_trywait, and sem_wait to GLIBC_2.1.
3196         * oldsemaphore.c: New file.
3197         * semaphore.c: Add default_symbol_versions for the changed functions.
3198         (__new_sem_init): Rename from sem_init.
3199         (__new_sem_post): Rename from sem_post.
3200         (__new_sem_wait): Rename from sem_wait.
3201         (__new_sem_trywait): Rename from sem_trywait.
3202         (__new_sem_getvalue): Rename from sem_getvalue.
3203         (__new_sem_destroy): Rename from sem_destroy.
3205 1999-06-23  Robey Pointer  <robey@netscape.com>
3207         * internals.h: Added p_nextlock entry to separate queueing for a
3208         lock from queueing for a CV (sometimes a thread queues on a lock
3209         to serialize removing itself from a CV queue).
3210         * pthread.c: Added p_nextlock to initializers.
3211         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
3213 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
3215         * manager.c (pthread_handle_create): Free mmap region after stack
3216         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
3218 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3220         * man/pthread_cond_init.man: Correct example.
3221         Reported by Tomas Berndtsson <tomas@nocrew.org>.
3223         * linuxthreads.texi (Condition Variables): Likewise.
3225 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
3227         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
3228         casx not cas, also successful casx returns the old value in rd
3229         and not the new value.
3231 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
3233         * manager.c: If pthread_create() is given a NULL attribute
3234         and the thread manager runs with a realtime policy, set the
3235         scheduling policy of the newly created thread back to SCHED_OTHER.
3236         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
3237         initialize the schedpolicy field of new_thread->p_start_args
3238         to that of the calling thread.
3240 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
3242         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
3243         instruction does not allow memory element to use offset.
3245 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
3247         * manager.c (pthread_allocate_stack): Optimize initialization of new
3248         thread descriptor.
3250         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
3251         Don't use initializer since it is all zeroes.
3252         (__libc_once_define): Likewise.
3254 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3256         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
3257         doesn't exist anymore.
3258         * sysdeps/i386/Implies: Likewise.
3259         * sysdeps/m68k/Implies: Likewise.
3260         * sysdeps/mips/Implies: Likewise.
3261         * sysdeps/powerpc/Implies: Likewise.
3262         * sysdeps/sparc/sparc32/Implies: Likewise.
3263         * sysdeps/sparc/sparc64/Implies: Likewise.
3265 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
3267         * sysdeps/alpha/bits/semaphore.h: Removed.
3268         * sysdeps/powerpc/bits/semaphore.h: Removed.
3269         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
3270         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
3271         * Makefile (headers): Remove bits/semaphore.h.
3273         * semaphore.h: Define _pthread_descr if necessary.
3274         Don't include limits.h.  Define SEM_VALUE_MAX directly.
3275         Define SEM_FAILED.
3276         (sem_t): Protect element names with leading __.
3277         Add declarations for sem_close, sem_open, and sem_unlink.
3278         * semaphore.c: Adjust all functions for new element names.
3279         Define sem_close, sem_open, and sem_unlink.
3280         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
3281         GLIBC_2.1.1.
3282         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
3283         necessary.
3285 1999-03-16  H.J. Lu  <hjl@gnu.org>
3287         * specific.c (pthread_key_delete): Check th->p_terminated to see
3288         if the thread is running.
3290         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
3291         Added to GLIBC_2.0 for libc.so.
3293 1999-02-12  H.J. Lu  <hjl@gnu.org>
3295         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
3296         __libc_allocate_rtsig): Added to GLIBC_2.1.
3298         * internals.h (DEFAULT_SIG_RESTART): Removed.
3299         (DEFAULT_SIG_CANCEL): Removed.
3301         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
3302         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
3303         (__pthread_sig_restart, __pthread_sig_cancel,
3304         __pthread_sig_debug): Initialized.
3305         (pthread_initialize): Call init_rtsigs () to initialize
3306         real-time signals.
3308 1999-02-03  H.J. Lu  <hjl@gnu.org>
3310         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
3311         Don't restart the thread which sent REQ_DEBUG.
3312         (pthread_start_thread): Check if __pthread_sig_debug > 0
3313         before debugging.
3315         * pthread.c (__pthread_initialize_manager): Suspend ourself
3316         after sending __pthread_sig_debug to gdb instead of
3317         __pthread_sig_cancel.
3319 1999-01-24  H.J. Lu  <hjl@gnu.org>
3321         * manager.c (__pthread_manager): Delete __pthread_sig_debug
3322         from mask if __pthread_sig_debug > 0.
3323         (pthread_handle_create): Increment __pthread_handles_num.
3325         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
3326         * pthread.c (__pthread_initialize_manager): Likewise.
3328         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
3329         instead of __libc_allocate_rtsig (2).
3330         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
3331         instead of __pthread_sig_cancel.
3332         (pthread_handle_sigdebug): Fix comments.
3334 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
3336         * manager.c (pthread_allocate_stack): Set
3337         __pthread_nonstandard_stacks if user-specified stack is used.
3339 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
3341         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
3342         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
3344 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
3346         * pthread.c: Use a third signal __pthread_sig_debug distinct
3347         from __pthread_sig_cancel to notify gdb when a thread is
3348         created
3349         * manager.c: Likewise.
3350         * internals.h: Likewise.
3351         * signals.c: The implementation of sigwait(s) assumed that
3352         all signals in s have signal handlers already attached.
3353         This is not required by the standard, so make it work
3354         also if some of the signals have no handlers.
3356 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3358         * linuxthreads.texi: Remove pointers from first @node.  Move old
3359         @node spec inside comment.
3361 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
3363         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
3364         _IO_lock_unlock.
3366 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
3368         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
3369         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
3371 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
3373         * manager.c: Threads now send __pthread_sig_cancel on termination.
3374         Change clone call and signal masks.
3375         * thread.c (pthread_handle_sigrestart): Remove special code for
3376         manager.
3377         (pthread_handle_sigcancel): In manager thread call
3378         __pthread_manager_sighandler.
3379         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
3380         * sysdeps/i386/i686/pt-machine.h: Likewise.
3381         Patches by Xavier Leroy.
3383 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
3385         * spinlock.c (__pthread_unlock): Don't crash if called for an
3386         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
3388         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
3389         overall runtime.
3391 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
3393         * Examples/ex3.c: Wait until all threads are started before
3394         searching for the number to avoid race condition on very fast
3395         systems.
3397 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3399         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
3400         declaration since it's not needed.
3402         * sysdeps/pthread/pthread.h: Move internal functions to ...
3403         * internals.h: ...here.
3405 1998-12-02  H.J. Lu  <hjl@gnu.org>
3407         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
3408         SIGRTMIN is defined.
3409         (__pthread_sig_cancel): Likewise.
3411 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3413         * wrapsyscall.c: Include <sys/mman.h> for msync,
3414         <stdlib.h> for system and <termios.h> for tcdrain prototype.
3415         Correct msync declaration.
3417 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
3419         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
3420         __libc_tsd_set): New macros for new interface.
3421         * no-tsd.c: New file, provide uninitialized defns of
3422         __libc_internal_tsd_get and __libc_internal_tsd_set.
3423         * Makefile (routines): Add no-tsd.
3425 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
3427         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
3428         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3429         __libc_internal_tsd_set): Move decls to ...
3430         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
3431         declarations.
3433         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3434         __libc_internal_tsd_set): Make these pointers to functions, not
3435         functions; remove #pragma weak decls for them.
3436         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
3437         Define static functions and initialized pointers to them.
3439 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
3441         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
3442         (CFLAGS-specific.c): Likewise.
3443         (CFLAGS-pthread.c): Likewise.
3444         (CFLAGS-ptfork.c): Likewise.
3445         (CFLAGS-cancel.c): Likewise.
3446         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
3447         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
3449         * mutex.c (pthread_mutex_init): Define as strong symbol.
3450         (pthread_mutex_destroy): Likewise.
3451         (pthread_mutex_trylock): Likewise.
3452         (pthread_mutex_lock): Likewise.
3453         (pthread_mutex_unlock): Likewise.
3454         (pthread_mutexattr_init): Likewise.
3455         (pthread_mutexattr_destroy): Likewise.
3456         (pthread_once): Likewise.
3457         * ptfork.c (pthread_atfork): Likewise.
3458         * specific.c (pthread_key_create): Likewise.
3459         (pthread_setspecific): Likewise.
3460         (pthread_getspecific): Likewise.
3462 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3464         * linuxthreads.texi: Fix punctuation after xref.
3466 1998-11-10  H.J. Lu  <hjl@gnu.org>
3468         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
3469         if it is defined in <linux/limits.h>.
3471 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
3473         * spinlock.h (__pthread_trylock): Define inline.
3474         (__pthread_lock): Add extra parameter to declaration.  Declare
3475         using internal_function.
3476         (__pthread_unlock): Declare using internal_function.
3477         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
3478         of local variable self.  Avoid recomputing self.  Define using
3479         internal_function.
3480         (__pthread_trylock): Remove.
3481         (__pthread_unlock): Define using internal_function.
3482         * cancel.c: Adjust for __pthread_lock interface change.  Use already
3483         computed self value is possible.
3484         * condvar.c: Likewise.
3485         * join.c: Likewise.
3486         * manager.c: Likewise.
3487         * mutex.c: Likewise.
3488         * pthread.c: Likewise.
3489         * rwlock.c: Likewise.
3490         * semaphore.c: Likewise.
3491         * signals.c: Likewise.
3493 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
3495         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
3496         __ to field names of the struct.
3497         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
3498         Likewise.
3499         (pthread_attr_t): Likewise.
3500         (pthread_cond_t): Likewise.
3501         (pthread_condattr_t): Likewise.
3502         (pthread_mutex_t): Likewise.
3503         (pthread_mutexattr_t): Likewise.
3504         (pthread_rwlock_t): Likewise.
3505         (pthread_rwlockattr_t): Likewise.
3506         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
3507         * cancel.c: Likewise.
3508         * condvar.c: Likewise.
3509         * manager.c: Likewise.
3510         * mutex.c: Likewise.
3511         * pthread.c: Likewise.
3512         * ptlongjmp.c: Likewise.
3513         * rwlock.c: Likewise.
3514         * spinlock.c: Likewise.
3516 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
3518         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
3519         also with PT_EI.
3521         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
3522         definitions.
3524         * Makefile (libpthread-routines): Add pt-machine.
3525         * pt-machine.c: New file.
3526         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
3527         yet defined.  Use PT_EI in extern inline definitions.
3528         * sysdeps/arm/pt-machine.h: Likewise.
3529         * sysdeps/i386/pt-machine.h: Likewise.
3530         * sysdeps/i386/i686/pt-machine.h: Likewise.
3531         * sysdeps/m68k/pt-machine.h: Likewise.
3532         * sysdeps/mips/pt-machine.h: Likewise.
3533         * sysdeps/powerpc/pt-machine.h: Likewise.
3534         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
3535         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3537 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3539         * semaphore.h: Include <sys/types.h> so that _pthread_descr
3540         is declared.
3542 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
3544         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
3545         argument.
3546         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
3548 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3550         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
3551         guard.
3553 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3555         * signals.c (sigaction): Check that sig is less than NSIG to avoid
3556         array index overflow.
3558 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
3560         * sysdeps/pthread/semaphore.h: New file.
3562 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
3564         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
3565         _LIBC_TSD_KEY_DL_ERROR.
3567 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
3569         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
3570         * sysdeps/i386/pt-machine.h: Likewise.
3571         Suggested by Roland McGrath.
3573 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
3575         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
3576         access thread data with non-constant offsets.
3577         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
3578         necessary.
3580         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
3581         THREAD_SETMEM_NC definitions.
3583         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
3584         THREAD_SETMEM_NC.
3585         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3587 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
3589         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
3590         not already defined.
3591         (struct _pthread_descr_struct): Add p_self and p_nr field.
3592         * manager.c (__pthread_handles): Define second element to point
3593         to manager thread.
3594         (__pthread_handles_num): Initialize to 2.
3595         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
3596         (pthread_start_thread): Likewise.
3597         (pthread_handle_create): Start search for free slot at entry 2.
3598         Initialize new fields p_self and p_nr.
3599         Call __clone with CLONE_PTRACE if available.
3600         (pthread_free): Call FREE_THREAD_SELF if available.
3601         * pthread.c (__pthread_initial_thread): Initialize new fields.
3602         (__pthread_manager_thread): Likewise.
3603         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
3605         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
3606         elements of the thread descriptor.
3607         * condvar.c: Likewise.
3608         * errno.c: Likewise.
3609         * join.c: Likewise.
3610         * manager.c: Likewise.
3611         * pthread.c: Likewise.
3612         * ptlongjmp.c: Likewise.
3613         * semaphore.c: Likewise.
3614         * signals.c: Likewise.
3615         * specific.c: Likewise.
3616         * spinlock.c: Likewise.
3618         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
3620         * sysdeps/i386/useldt.h: New file.
3621         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
3623         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
3624         THREAD_SETMEM using __thread_self.
3625         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3627 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
3629         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
3630         turned out that we didn't need to queue after all.
3632 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
3634         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
3635         and wastes space; correct types.
3637 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
3639         * signals.c (sigaction): Handle NULL argument.
3641 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
3643         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
3644         of sigset_t.
3646 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3648         * Makefile (linuxthreads-version): Extract correct number from
3649         Banner.
3651 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
3653         * Banner: Bump version number to 0.8
3654         * FAQ.html: Many updates, in particular w.r.t. debugging.
3655         * manager.c: Support for non-default stacksize for
3656         LinuxThreads-allocated stacks;
3657         don't use guard pages for stacks with default size, rely on
3658         rlimit(RLIMIT_STACK) instead (it's cheaper).
3659         * attr.c: Likewise.
3660         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
3661         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
3662         * condvar.c: Likewise.
3663         * internals.h: Likewise.
3664         * restart.h: Likewise.
3665         * signals.c: Likewise.
3666         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
3668 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3670         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
3671         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
3672         * Versions: Put __pthread_mutexattr_settype under version
3673         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
3674         __pthread_mutexattr_gettype.
3676 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3678         * sysdeps/pthread/bits/libc-lock.h: Make
3679         __pthread_mutexattr_settype weak.  Don't make
3680         __pthread_mutexattr_setkind_np weak.
3682 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
3684         * manager.c (pthread_handle_create): Check whether sched_setscheduler
3685         call can succeed here.
3687         * mutex.c: Define __pthread_mutexattr_settype and make
3688         __pthread_mutexattr_setkind_np an alias.
3689         Likewise for __pthread_mutexattr_gettype.
3691 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3693         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
3694         is root.
3696 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
3698         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
3700 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3702         * Examples/ex6.c: Include <unistd.h> for usleep.
3704 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3706         * Examples/ex4.c (main): Use exit, not pthread_exit.
3708 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
3710         * Versions: Add __pthread_mutexattr_gettype and
3711         __pthread_mutexattr_settype.
3712         * lockfile.c: Use __pthread_mutexattr_settype instead of
3713         __pthread_mutexattr_setkind_np.
3714         * mutex.c: Define __pthread_mutexattr_gettype and
3715         __pthread_mutexattr_settype.
3716         * weak.c: Likewise.
3717         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
3718         __pthread_mutexattr_settype.
3719         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
3720         Use __pthread_mutexattr_settype.
3722 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
3724         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
3725         * mutex.c: Define weak alias pthread_mutexattr_gettype and
3726         pthread_mutexattr_settype.
3727         * sysdeps/pthread/pthread.h: Declare these functions.
3728         Move pthread_sigmask and pthread_kill declaration in separate header.
3729         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
3731 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
3733         * Makefile: Add rules to compile and run tests.
3734         * Examples/ex1.c: Little changes to fix warnings.
3735         * Examples/ex2.c: Likewise.
3736         * Examples/ex3.c: Likewise.
3737         * Examples/ex4.c: Likewise.
3738         * Examples/ex5.c: Likewise.
3739         * Examples/ex6.c: New file.
3741 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
3743         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
3745 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3747         * attr.c: Include <string.h>.
3749 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
3751         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
3752         * internals.h: Include limits.h.
3753         * manager.c: Use memcpy to copy sched_param.
3754         * ptfork.c: Include errno.h.
3755         * pthread.c: Likewise.
3756         * semaphore.c: Likewise.
3757         * specific.c: Likewise.
3758         * spinlock.h: Likewise.
3759         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
3760         type definition to ...
3761         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
3763 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
3765         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
3767         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
3768         as macros as demanded in POSIX.1, Annex C.
3770 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
3772         * internals.h (struct pthread_request): For free use pthread_t
3773         instead of pthread_descr.
3774         * join.c (pthread_join): Pass thread_id, not th to manager.
3775         (pthread_detach): Likewise.
3776         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
3777         (pthread_exited): Remove detached queue code.
3778         (pthread_handle_free): Expect thread ID parameter and use it to
3779         validate the thread decsriptor.  Don't use detached queue.
3780         Patches by Xavier Leroy.
3782 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3784         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
3785         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
3786         __pthread_atfork, __pthread_key_create, __pthread_once.
3787         * internals.h: Doc fix.
3788         * pthread.c (__pthread_initialize): Define again.
3790 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
3792         * manager.c (pthread_exited): If thread is not detached put it on
3793         special list.
3794         (pthread_handle_free): If thread is not on list with living threads
3795         search on list with detached threads.
3797         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
3798         for new definition of pthread_rwlock_t.
3800         * spinlock.c: Correct test whether to compile
3801         __pthread_compare_and_swap or not.
3803 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
3805         * attr.c: Finish user stack support.  Change locking code to be safe
3806         in situations with different priorities.
3807         * cancel.c: Likewise.
3808         * condvar.c: Likewise.
3809         * internals.h: Likewise.
3810         * join.c: Likewise.
3811         * manager.c: Likewise.
3812         * mutex.c: Likewise.
3813         * pthread.c: Likewise.
3814         * ptlongjmp.c: Likewise.
3815         * queue.h: Likewise.
3816         * rwlock.c: Likewise.
3817         * semaphore.c: Likewise.
3818         * semaphore.h: Likewise.
3819         * signals.c: Likewise.
3820         * spinlock.c: Likewise.
3821         * spinlock.h: Likewise.
3822         * sysdeps/pthread/pthread.h: Likewise.
3823         Patches by Xavier Leroy.
3825         * sysdeps/i386/i686/pt-machine.h: New file.
3827 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
3829         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
3830         [sg]et_stackaddr prototypes always available.
3832         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3833         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
3835 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
3837         * manager.c (pthread_free): Undo patch from 980430.
3838         Reported by David Wragg <dpw@doc.ic.ac.uk>.
3840 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
3842         * manager.c: Define __pthread_manager_adjust_prio and use it to
3843         increase priority when needed.
3844         * internals.h: Add prototype for __pthread_manager_adjust_prio.
3845         * mutex.c: Optimize mutexes to wake up only one thread.
3846         * pthread.c: Move PID of manager for global variable in structure
3847         element.
3848         Patches by Xavier Leroy.
3850 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
3852         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
3854 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3856         * attr.c: Correct typo.
3858 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
3860         * manager.c (pthread_free): Unmap guard before the stack.
3861         Patch by Matthias Urlichs.
3863 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
3865         * manager.c (pthread_free): Detect already free child.
3866         Patch by Xavier Leroy, reported by Matthias Urlichs.
3868 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3870         * Makefile (linuxthreads-version): Renamed back from
3871         libpthread-version.
3873 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
3875         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
3876         __libc_longjmp.
3878 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
3880         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
3881         * internals.h: Add definitions for new spinlock implementation.
3882         * ptlongjmp.c: New file.
3883         * spinlock.c: New file.
3884         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
3885         new function __pthread_acquire to prevent deadlocks with thread
3886         with different priorities.
3887         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
3889 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3891         * manager.c (__pthread_manager): Reduce first argument to select
3892         to include just the needed file descriptor.
3894 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
3896         * manager.c: Fix last patch which caused core dumps.
3898         * pthread.c: Correctly handle missing SIGRTMIN.
3900 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3902         * libpthread.map: Add __libc_internal_tsd_get and
3903         __libc_internal_tsd_set.  Add missing cancelable functions. Export
3904         libc internal versions of the cancelable functions.
3906 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
3908         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
3910 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
3912         * attr.c: Implement pthread_attr_[gs]etguardsize,
3913         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
3914         Change pthread_attr_init to have two interfaces.
3915         * internals.h (struct _pthread_descr_struct): Add new fields for
3916         above functions.
3917         * libpthread.map: Add names in GLIBC_2.1 section.
3918         * manager.c (pthread_handle_create): Implement guardsize and
3919         user stack.
3920         (pthread_free): Likewise.
3921         * pthread.c (pthread_create): Add new interface for changed
3922         pthread_attr_t.
3923         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
3924         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
3925         PTHREAD_STACK_MIN.
3927 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
3929         * manager.c: Enable resetting of the thread scheduling policy
3930         to SCHED_OTHER when the parent thread has a different one.
3932 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
3934         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3935         _POSIX_ASYNCHRONOUS_IO.
3937         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
3938         mutexes.
3939         * mutex.c: Implement new mutex types.
3941         * internals.h: Include <signal.h>.
3943         * libpthread.map: Add __erno_location and __h_errno_location.
3945         * errno.c: Return pointer to variable actually in use.  This might
3946         not be the one in the thread structure.
3947         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
3948         and p_h_errnop.
3949         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
3950         of manager thread structure.
3951         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
3952         thread.
3953         * pthread.c: Adapt initializer for thread structures.
3954         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
3955         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
3956         current thread to global variables.
3958 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
3960         * rwlock.c: New file.
3961         * Makefile (libpthread-routines): Add rwlock.
3962         * sysdeps/pthread/pthread.h: Define data structures and declare
3963         functions.
3964         * libpthread.map: Add new functions.
3966 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
3968         * sysdeps/arm/pt-machine.h: New file; add ARM support.
3969         * sysdeps/arm/Implies: likewise.
3970         * README: Document it.
3972 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3974         * signals.c: Remove unneeded initializer for sigwaited, saving a
3975         warning.
3977 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3979         * semaphore.c (sem_init): Set sem_spinlock only if available.
3981 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
3983         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3984         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3986         * Makefile: Update from LinuxThreads 0.7.
3987         * internals.h. Likewise.
3988         * manager.c: Likewise.
3989         * mutex.c: Likewise.
3990         * pthread.c: Likewise.
3991         * signals.c: Likewise.
3992         * specific.c: Likewise.
3993         * Examples/ex3.c: Likewise.
3995 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
3997         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3998         open.
4000 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
4002         * wrapsyscall.c: Add socket functions which are also cancelation
4003         points.
4005 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
4007         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
4008         New functions for fast thread specific data within libc.
4010         * internals.h: Add new array p_libc_specific to struct
4011         _pthread_descr_struct.
4013         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
4015 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
4017         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
4018         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
4020 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
4022         * internals.h (struct _pthread_descr_struct): Add definitions for
4023         two-level specific key handling.
4024         * manager.c (pthread_handle_create): Initialize specific memory array.
4025         * specific.c: Implement two-level key handling.
4026         * weaks.c: Don't provide dummy key handling.
4027         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
4028         Add definition of __libc_key_t.
4029         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
4030         as 1024.
4031         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
4032         PTHREAD_DESTRUCTOR_ITERATIONS.
4034         * manager.c (pthread_handle_create): Compare mmap result with
4035         MAP_FAILED.
4037         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
4038         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
4040 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
4042         sysdeps/sparc -> sysdeps/sparc/sparc32
4043         sysdeps/sparc64 -> sysdeps/sparc/sparc64
4045         * internals.h: Change definition of THREAD_SELF to be an expression,
4046         not a statement that did a return.
4047         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
4048         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
4049         Follow Solaris and use a "system reserved" register (%g6) to hold
4050         the thread descriptor.
4051         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
4053 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
4055         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
4056         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
4057         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
4059         * semaphore.c: Include spinlock.h only when needed.
4061         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
4062         keys for entries not in use.
4064         * weaks.c: Implement key handling functions for real.
4066 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
4068         Initial sparc64-linux support:
4069         * sysdeps/sparc64/Implies: New file.
4070         * sysdeps/sparc64/pt-machine.h: Likewise.
4072 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
4074         * semaphore.c: Include spinlock.h at correct place.
4075         Patch by HJ Lu.
4077 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
4079         The Great Bit File Move:
4080         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
4081         * sysdeps/powerpc/semaphorebits.h: Likewise.
4082         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
4083         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
4084         * sysdeps/pthread/libc-lock.h: -> bits/
4085         * sysdeps/pthread/stdio-lock.h: Likewise.
4086         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
4087         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
4088         * semaphore.h: Likewise.
4089         * sysdeps/pthread/pthread.h: Likewise.
4091         * lockfile.c: <foo.h> -> <bits/foo.h>.
4092         * semaphore.h: Likewise.
4094         * Makefile: (headers): foo.h -> bits/foo.h.
4095         * sysdeps/pthread/Makefile: Likewise.
4097 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
4099         * semaphore.c (sem_init): Set sem_spinlock only if available.
4101         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
4102         asm constraints.
4104 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
4106         Update from LinuxThreads 0.6.
4108         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
4109         and __sched_get_priority_min instead of names without `__'.
4111         * manager.c: Rewrite large parts to implement opaque pthread_t.
4113         * cancel.c: Adapt for opaque pthread_t type.
4114         * condvar.c: Likewise.
4115         * errno.c: Likewise.
4116         * join.c: Likewise.
4117         * mutex.c: Likewise.
4118         * pthread.c: Likewise.
4119         * signals.c: Likewise.
4120         * specific.c: Likewise.
4121         * restart.h: Likewise.
4122         * queue.h: Likewise.
4123         * Examples/ex3.c: Likewise.
4124         * Examples/ex4.c: Likewise.
4125         * sysdeps/pthread/pthread.h: Likewise.
4127         * pthread.c: Accumulate time for all threads in thread manager.
4129         * semaphore.c: Implement fallback implementation for architectures
4130         sometimes missing compare-exchange operations.
4132         * cancel.c (pthread_cancel): Validate handle argument.
4133         * join.c (pthread_join): Likewise.
4134         (pthread_detach): Likewise.
4135         * signals.c (pthread_kill): Likewise.
4137         * spinlock.h (acquire): Use __sched_yield not sched_yield.
4139         * queue.h (enqueue): Enqueue thread according to priority.
4141         * internals.c (struct pthread_start_args): New struct for passing
4142         args to cloning function.
4143         (struct _pthread): Rename to _pthread_descr_struct and adapt for
4144         opaque pthread_t.
4146         * Examples/Makefile (clean): Pass -f option to rm.
4148         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
4149         and define TEST_FOR_COMPARE_AND_SWAP.
4150         * sysdeps/i386/i486/pt-machine.h: Removed.
4152         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
4153         to 1024.
4155 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
4157         * restart.h (suspend): Clear p_signal before suspending.
4158         (suspend_with_cancellation): Likewise.
4159         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
4161         * weaks.c: Make __pthread_key_create return 1.
4162         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
4163         __libc_getspecific, __libc_setspecific, and __libc_key_t.
4164         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
4165         using libio.
4167 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
4169         * sysdeps/sparc/pt-machine (RELEASE): Fix.
4171 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
4173         * sysdeps/powerpc/Implies: Added.
4174         * sysdeps/powerpc/pt-machine.h: Added.
4175         * sysdeps/powerpc/semaphorebits.h: Added.
4177 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
4179         * pthread.c (__pthread_initial_thread): Correct
4180         initializer.
4181         (__pthread_manager_thread): Likewise.
4182         Reported by Andreas Jaeger.
4184 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
4186         Since sigset_t no longer fits in a register, we can't pass in the
4187         thread's initial mask so easily.  Take this opportunity to simplify
4188         the clone implementation by only accepting a single void* argument.
4190         * manager.c (__pthread_manager): Put thread vitals in the thread
4191         struct instead of as arguments through clone.
4192         (pthread_start_thread): Look for them there.
4193         * internals.h (struct _pthread): Add p_initial_fn,
4194         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
4195         * pthread.c (pthread_initialize_manager): Revise clone invocation.