Update.
[glibc.git] / linuxthreads / ChangeLog
blobbc124a13c133907fb628522f4ad2f8ccee19b107
1 2002-08-25  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/pthread/timer_routines.c (thread_func): Make the
4         compiler happy by adding a return statement which will never be
5         reached.
7         * tst-context.c (main): Cast to long before casting to pointer.
9         * Examples/ex17.c (main): Use correct format string.
11         * Examples/ex9.c (thread): Remove incorrect return statement.
13 2002-08-23  Ulrich Drepper  <drepper@redhat.com>
15         * pthread.c (__linuxthreads_version): New global constant.
17 2002-08-23  Andreas Jaeger  <aj@suse.de>
19         * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
20         as thread specific register.
21         (testandset): Fix inline asm.
22         (THREAD_GETMEM): Fix inline asm.
24 2002-08-22  Roland McGrath  <roland@redhat.com>
26         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
27         conditional.
28         (INIT_THREAD_SELF): Pass second arg to DO_SET_THREAD_AREA.
29         (DO_SET_THREAD_AREA): Take second arg, pass to DO_SET_THREAD_AREA_REUSE
30         macro.  That chooses whether to reuse %gs value or let kernel set it.
31         [USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, always 1.
32         [!USE_TLS] (DO_SET_THREAD_AREA_REUSE): New macro, true if arg is
33         not constant 0.
35 2002-08-21  Ulrich Drepper  <drepper@redhat.com>
37         * sysdeps/i386/tls.h (TLS_SETUP_GS_SEGMENT): Add new parameter
38         also to the third definition of this macro.
40 2002-06-17  Andreas Jaeger  <aj@suse.de>
42         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
43         Set it.
45 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
47         * sysdeps/i386/useldt.h: Go back to using 16-bit instructions when
48         loading/reading segment registers.  Some old hardware doesn't
49         handle the 32-bit instructions as expected.
50         * sysdeps/i386/tls.h: Likewise.
52         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
53         renamed to secondcall and use is negated.
54         (TLS_SETUP_GS_SEGMENT): Likewise.
55         (TLS_INIT_TP): Likewise.
56         * sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
57         secondcall.
59         * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
60         registers.  No need to mask upper 16 bits in this case.
61         * sysdeps/i386/useldt.h: Likewise.
62         (DO_SET_THREAD_AREA): We have to load %gs again even if the value
63         is the same since the GDT content changed.
65         * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
66         to TLS_SETUP_GS_SEGMENT.
67         (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
68         TLS_DO_SET_THREAD_AREA.
69         (TLS_DO_SET_THREAD_AREA): If new parameter is zero determine
70         entry number from %gs value.
71         * sysdeps/sh/tls.h (TLS_INIT_TP): Add new parameter and simply
72         ignore it.
74         * manager.c (pthread_handle_create): Pass NULL to _dl_allocate_tls.
75         Pass true to _dl_deallocate_tls.
76         (pthread_free): Likewise.
77         * pthread.c (__pthread_initialize_manager): Likewise.
79 2002-08-19  Ulrich Drepper  <drepper@redhat.com>
81         * sysdeps/i386/useldt.h (DO_SET_THREAD_AREA): Use correct shift when
82         computing index from %gs value.
84 2002-08-16  Roland McGrath  <roland@redhat.com>
86         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Calculate segment
87         register value from entry number properly.
89         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Rewrite asm to use %ebx
90         optimally conditional on [__PIC__].
91         (TLS_DO_SET_THREAD_AREA): New macro, implement inline syscall
92         without touching errno, and use latest modify_ldt-like interface.
93         (TLS_SETUP_GS_SEGMENT): Use that instead of INLINE_SYSCALL.
94         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Set %gs in this macro.
95         (DO_SET_THREAD_AREA): New macro, uses current syscall interface with
96         existing %gs value as the segment to set.
97         (INIT_THREAD_SELF): Rewritten using those.  Use set_thread_area only
98         under [HAVE_TLS_SUPPORT] so we can rely on the initialization done
99         by the first thread's early TLS setup.
101 2002-08-15  Roland McGrath  <roland@redhat.com>
103         * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
104         return a value as callers now expect.
106 2002-08-11  Roland McGrath  <roland@redhat.com>
108         * pthread.c (__pthread_initialize_manager): Initialize
109         p_header.data.tcb field of manager thread's descriptor.
110         (__pthread_initialize_minimal): Don't initialize p_header.data.self
111         field, already done by TLS_INIT_TP.
113         * manager.c (pthread_handle_create): Move p_header field initializers
114         together.
116 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
118         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
120 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
122         * pthread.c (__linuxthreads_initial_report_events): New variable.
123         (__pthread_initialize_manager): Use it to initialize p_report_events
124         of initial thread.
125         [TLS]: Store pointer to descriptor of manager in __pthread_handles.
127 2002-08-07  Roland McGrath  <roland@redhat.com>
129         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): Add an extra argument with
130         an "m" constraint to the asm so the compiler knows LDT_ENTRY was used.
132 2002-08-02  Roland McGrath  <roland@redhat.com>
134         * sysdeps/pthread/bits/libc-tsd.h (enum __libc_tsd_key_t):
135         Add _LIBC_TSD_KEY_LOCALE.
136         * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
137         Call __uselocale to initialize our per-thread locale pointer to
138         the global one.
139         * pthread.c (__pthread_initialize_minimal): Likewise.
141         * sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Add missing \s.
143 2002-08-02  Ulrich Drepper  <drepper@redhat.com>
145         * pthread.c: Declare _errno, _h_errno, and _res unless we use TLS
146         internally.
148         * cancel.c (__pthread_perform_cleanup) [USE_TLS && HAVE___THREAD]:
149         Don't use p_libc_specific element in thread descriptor.
151 2002-07-30  Roland McGrath  <roland@redhat.com>
153         * sysdeps/pthread/bits/libc-tsd.h: Include <tls.h>.
154         [USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
155         which does the right thing when __thread support is available.
156         * descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
157         Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
158         `p_h_errno', `p_resp', and `p_res' members.
159         * pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
160         Don't initialize `p_errnop' and `p_h_errnop' members.
161         (__pthread_reset_main_thread): Likewise.
162         (__pthread_initialize_manager): Likewise.
163         * manager.c (__pthread_manager, pthread_handle_create): Likewise.
164         * pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
165         Don't initialize `p_resp' member.
166         (__pthread_reset_main_thread): Likewise.
167         * manager.c (pthread_handle_create): Likewise.
168         * specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
169         Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
170         * no-tsd.c: Conditionalize contents on [!(USE_TLS && HAVE___THREAD)].
171         * errno.c [USE_TLS && HAVE___THREAD]
172         (__h_errno_location, __res_state): Don't define these at all.
174         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
175         (INSTALL_NEW_DTV, GET_DTV): Likewise.
176         * sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
178         * weaks.c: Don't include <errno.h> here.
180 2002-08-01  Roland McGrath  <roland@redhat.com>
182         * sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
183         TLS_INIT_TP.
184         (TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
185         (TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
186         (TLS_INIT_TP): Use that.
188 2002-08-02  Jakub Jelinek  <jakub@redhat.com>
190         * sysdeps/i386/useldt.h (DO_MODIFY_LDT): Move from INIT_THREAD_SELF.
191         (INIT_THREAD_SELF): Use sys_thread_area syscall instead if available.
192         (FREE_THREAD): Avoid modify_ldt if using GDT.
193         * sysdeps/i386/pspinlock.c (__have_no_set_thread_area): New variable.
195 2002-07-25  Jakub Jelinek  <jakub@redhat.com>
197         * sysdeps/i386/tls.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
198         * sysdeps/i386/pt-machine.h: Likewise.
199         * sysdeps/i386/useldt.h: Likewise.
201 2002-07-22  Ulrich Drepper  <drepper@redhat.com>
203         * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
204         call __libc_setup_tls first.
205         * Makefile: Actually create tst-signal.out file when running the test.
206         (tests): Add tststatic.
207         * Examples/tststatic.c: New file.
209 2002-07-19  Ulrich Drepper  <drepper@redhat.com>
211         * errno.c (__errno_location): Don't define unless !USE_TLS
212         || !HAVE___THREAD.
213         * sysdeps/i386/pt-machine.c: Protect C code with #ifndef ASSEMBLER.
214         * sysdeps/i386/tls.h: Likewise.
215         * sysdeps/i386/useldt.h: Likewise.
216         * sysdeps/i386/i686/pt-machine.h: Likewise.
218 2002-07-02  H.J. Lu  <hjl@gnu.org>
220         * sysdeps/mips/pspinlock.c: Don't include <sgidefs.h>.  Always
221         use ll/sc.
222         * sysdeps/mips/pt-machine.h: Likewise.
224 2002-07-14  Ulrich Drepper  <drepper@redhat.com>
226         * manager.c (pthread_handle_create): Initialize self-reference in
227         descriptor.
229 2002-07-01  Jakub Jelinek  <jakub@redhat.com>
231         * Examples/ex9.c (main): Remove unused th variable.
233 2002-07-10  Ulrich Drepper  <drepper@redhat.com>
235         * wrapsyscall.c: Add __nanosleep alias.
236         * Versions (GLIBC_2.2.6): Add __nanosleep.
237         * bug-sleep.c: New file.
238         * Makefile (tests): Add bug-sleep.
240 2002-06-19  Steven Munroe  <sjmunroe@vnet.ibm.com>
242         * Examples/ex9.c (main):  Use list of children and join them.
243         (thread): Do not call exit.
245 2002-06-20  Ulrich Drepper  <drepper@redhat.com>
247         * spinlock.c (wait_node_alloc): We cannot use compare-and-exchange.
248         Unconditionally use the code using spinlock.  Use __pthread_release
249         to free a spinlock.
250         (wait_node_free): Likewise.
251         (__pthread_acquire, __pthread_release): Unconditionally define.
253 2002-06-07  Jakub Jelinek  <jakub@redhat.com>
255         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Fix typo.
257 2002-05-24  Ulrich Drepper  <drepper@redhat.com>
259         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Use __sync_synchronize.
261 2002-05-21  Ulrich Drepper  <drepper@redhat.com>
263         * sysdeps/pthread/pthread.h (pthread_create): Rename first
264         parameter.
265         (pthread_cancel): Likewise.
266         * internals.h (__pthread_create_2_1): Likewise.
267         * sysdeps/unix/sysv/linux/bits/sigthread.h (pthread_kill): Likewise.
269 2002-05-20  Ulrich Drepper  <drepper@redhat.com>
271         * sysdeps/alpha/pt-machine.c (THREAD_SELF): Remove clobber.
272         Patch by Glen Nakamura <gen@flex.com>.
274 2002-05-03  Ulrich Drepper  <drepper@redhat.com>
276         * signals.c: Move sighandler functions to...
277         * sighandler.c: ...here.  New file.
278         * signals.c: Move signal handler related type definitions to...
279         * internals.h: ...here.  Add prototypes for signal handlers.
280         * Makefile (libpthread-routines): Add sighandler.
281         (CFLAGS-sighandler.c): Add $(exceptions).
283 2002-04-30  Jakub Jelinek  <jakub@redhat.com>
285         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
287 2002-04-08  Ulrich Drepper  <drepper@redhat.com>
289         * sysdeps/pthread/timer_getoverr.c: Return real overrun.
290         * sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
291         * sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
292         based on previous one and not on current time.  Count overruns.
293         Patch by Eric F. Sorton <eric@cctcorp.com>.
295         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
297 2002-04-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
299         * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
300         if it isn't defined yet.
301         (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
302         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
303         Likewise.
304         * sysdeps/sh/tls.h: New file.
306 2002-04-08  Jakub Jelinek  <jakub@redhat.com>
308         * manager.c (__pthread_manager_event): Use self instead of arg
309         for INIT_THREAD_SELF.
310         * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct
311         _pthread_descr_struct) instead of sizeof (*descr).
313 2002-04-05  Ulrich Drepper  <drepper@redhat.com>
315         * sysdeps/ia64/pt-machine.h: Protect against multiple inclusion.
316         * sysdeps/alpha/pt-machine.h: Likewise.
317         * sysdeps/arm/pt-machine.h: Likewise.
318         * sysdeps/cris/pt-machine.h: Likewise.
319         * sysdeps/hppa/pt-machine.h: Likewise.
320         * sysdeps/m68k/pt-machine.h: Likewise.
321         * sysdeps/mips/pt-machine.h: Likewise.
322         * sysdeps/powerpc/pt-machine.h: Likewise.
323         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
324         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
325         * sysdeps/sh/pt-machine.h: Likewise.
326         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
327         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
328         * sysdeps/x86_64/pt-machine.h: Likewise.
330 2002-04-05  Jakub Jelinek  <jakub@redhat.com>
332         * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document
333         instead of pthread_mutexattr_setkind_np.
334         (pthread_mutexattr_gettype): Similarly.
335         * man/pthread_mutexattr_setkind_np.man: New.
336         * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man.
338 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
340         * sysdeps/ia64/pt-machine.h (MEMORY_BARRIER): Define.
342 2002-03-22  Jakub Jelinek  <jakub@redhat.com>
344         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Remove.
346 2002-03-22  Ulrich Drepper  <drepper@redhat.com>
348         * internals.h (MEMORY_BARRIER): Define as asm with memory as clobber.
350 2002-03-17  Andreas Jaeger  <aj@suse.de>
352         * sysdeps/i386/pt-machine.h: Add testandset and __compare_and_swap
353         prototpyes.
354         * sysdeps/alpha/pt-machine.h: Likewise.
355         * sysdeps/arm/pt-machine.h: Likewise.
356         * sysdeps/cris/pt-machine.h: Likewise.
357         * sysdeps/hppa/pt-machine.h: Likewise.
358         * sysdeps/i386/i686/pt-machine.h: Likewise.
359         * sysdeps/ia64/pt-machine.h: Likewise.
360         * sysdeps/m68k/pt-machine.h: Likewise.
361         * sysdeps/mips/pt-machine.h: Likewise.
362         * sysdeps/powerpc/pt-machine.h: Likewise.
363         * sysdeps/s390/s390-32/pt-machine.h: Likewise.
364         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
365         * sysdeps/sh/pt-machine.h: Likewise.
366         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
367         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
368         * sysdeps/x86_64/pt-machine.h: Likewise.
370         * internals.h: Move testandset and __compare_and_swap prototypes
371         to pt-machine.h.
373 2002-03-03  Andreas Jaeger  <aj@suse.de>
375         * errno.c: Include resolv.h to avoid warning.
377 2002-02-27  Ulrich Drepper  <drepper@redhat.com>
379         * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
380         stack limit.
382 2002-02-23  Ulrich Drepper  <drepper@redhat.com>
384         * attr.c (pthread_getattr_np): Don't take thread descriptor size
385         into account if USE_TLS.
386         * manager.c (pthread_handle_create): Free TLS data structures if call
387         failed.  Pass correct stack to clone if USE_TLS.
388         * sysdeps/i386/pt-machine.h: Handle multiple inclusion.
389         * sysdeps/i386/i686/pt-machine.h: Likewise.
390         * sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
392         * descr.h (struct _pthread_descr_struct): Update p_header for TLS.
393         Add p_stackaddr element #if USE_TLS.
394         * internals.c: Include <tls.h>.
395         * manager.c: Integrate creating and handling of thread descriptor
396         for TLS.
397         * pthread.c: Likewise.
398         * sysdeps/i386/tls.h (tcbhead_t): Add self pointer.
399         Include <linuxthreads/descr.h> only if TLS is really used.
400         (GET_DTV): New macro.
401         (TLS_INIT_TP): Initialize self pointer.
403 2002-02-17  Andreas Schwab  <schwab@suse.de>
405         * signals.c (sigwait): Check for old sighandler being SIG_ERR,
406         not NULL.
408 2002-02-12  Ulrich Drepper  <drepper@redhat.com>
410         * sysdeps/i386/tls.c (INSTALL_NEW_DTV): Define.
411         (INSTALL_DTV): Adjust for being passed pointer to element with length.
413 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
415         * sysdeps/i386/tls.h (TLS_INIT_TP): Also initialize %gs.
417 2002-02-08  Richard Henderson  <rth@redhat.com>
419         * sysdeps/alpha/elf/pt-initfini.c: Use \n\ for multiline string.
421 2002-02-08  Ulrich Drepper  <drepper@redhat.com>
423         * sysdeps/i386/tls.h: TLS cannot be supported with FLOATING_STACKS
424         after all.
426 2002-02-07  H.J. Lu  <hjl@gnu.org>
428         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Silence the
429         gcc warning.
430         (__pthread_spin_lock): Remove ".set noreorder".
431         * sysdeps/mips/pt-machine.h (__compare_and_swap): Liekwise.
433 2002-02-05  H.J. Lu  <hjl@gnu.org>
435         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Not use
436         branch likely.
437         * sysdeps/mips/pt-machine.h (testandset): Likewise.
438         (__compare_and_swap): Likewise.
440 2002-02-07  Ulrich Drepper  <drepper@redhat.com>
442         * internals.h: Move declarations/definitions of
443         __pthread_initial_thread_bos, __pthread_initial_thread,
444         __pthread_manager_thread_bos, __pthread_manager_thread_tos,
445         __pthread_manager_thread, __pthread_nonstandard_stacks, STACK_SIZE,
446         CURRENT_STACK_FRAME, __pthread_find_self, and thread_self...
447         * descr.h: ...here.
448         * sysdeps/i386/tls.h: Add TLS definitions also for !FLOATING_STACKS.
449         Define THREAD_GETMEM accordingly.
451 2002-02-06  Ulrich Drepper  <drepper@redhat.com>
453         * sysdeps/i386/tls.h: Include <stddef.h> for size_t.
455         * sysdeps/i386/tls.h: Define THREAD_DTV.
457 2002-02-04  Ulrich Drepper  <drepper@redhat.com>
459         * internals.h: Move thread descriptor definition...
460         * descr.h.: ...here.  New file.
461         * sysdeps/i386/tls.h: New file.
463 2002-02-01  H.J. Lu  <hjl@gnu.org>
465         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Use a
466         different register in the delayed slot.  Use branch likely.
468         * sysdeps/mips/pt-machine.h (testandset): Call _test_and_set.
469         (__compare_and_swap): Return 0 only when failed to compare. Use
470         branch likely.
472 2002-02-01  Jakub Jelinek  <jakub@redhat.com>
474         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set,
475         __pthread_kill_other_threads_np): Move to GLIBC_PRIVATE.
476         * sysdeps/i386/i586/Versions: Move all symbols to GLIBC_PRIVATE.
477         * sysdeps/i386/i686/Versions: Move all symbols to GLIBC_PRIVATE.
478         * sysdeps/sparc/sparc32/sparcv9/Versions: New file.
479         * sysdeps/sparc/sparc64/Versions: New file.
480         * sysdeps/ia64/Versions: Move all symbols to GLIBC_PRIVATE.
482 2002-01-31  Ulrich Drepper  <drepper@redhat.com>
484         * pthread.c: _dl_cpuclock_offset is not any longer a global variable
485         in SHARED code, use GL(dl_cpuclock_offset).
487 2002-01-28  Andreas Jaeger  <aj@suse.de>
489         * sysdeps/mips/pspinlock.c (__pthread_spin_init): Clear *LOCK to
490         0. Patch by Machida Hiroyuki <machida@sm.sony.co.jp>.
492 2002-01-16  Martin Schwidefsky  <schwidefsky@de.ibm.com>
494         * sysdeps/s390/s390-32/pt-machine.h (MEMORY_BARRIER): Define.
495         (CURRENT_STACK_FRAME): Remove duplicate definition.
496         * sysdeps/s390/s390-64/pt-machine.h: Likewise.
498 2002-01-14  Martin Schwidefsky  <schwidefsky@de.ibm.com>
500         * Makefile (CFLAGS-tst-cancel.c): Add -fno-inline-functions to prevent
501         automatic inline.
503 2002-01-12  Andreas Schwab  <schwab@suse.de>
505         * Makefile (test-srcs): Add tst-signal.
506         (tests): Run tst-signal.
507         (distribute): Add tst-signal.sh.
508         * tst-signal.c, tst-signal.sh: New files.
510 2002-01-14  Andreas Jaeger  <aj@suse.de>
512         * sysdeps/x86_64/pt-machine.h (INIT_THREAD_SELF): Avoid warning.
514 2002-01-11  Andreas Schwab  <schwab@suse.de>
516         * signals.c (sighandler): Initialize all elements to SIG_ERR.
517         (__sigaction): Don't use value from sighandler if it is SIG_ERR.
519 2002-01-06  Richard Henderson  <rth@redhat.com>
521         * sysdeps/alpha/elf/pt-initfini.c: New file.
523 2001-12-29  Andreas Jaeger  <aj@suse.de>
525         * Examples/ex9.c: Add noreturn attribute for thread.
526         * Examples/ex10.c: Likewise.
527         * Examples/ex13.c (thread_start): Likewise.
528         * Examples/ex15.c (worker): Likewise.
530         * Examples/ex18.c: Include unistd.h for prototype of sleep.
532 2001-12-14  Ulrich Drepper  <drepper@redhat.com>
534         * man/pthread_atfork.man: Adjust description of mutex handling
535         after fork for current implementation.
536         * linuxthreads.texi: Likewise [PR libc/2519].
538 2001-12-13  Andreas Schwab  <schwab@suse.de>
540         * specific.c (pthread_key_delete): Don't contact the thread
541         manager if no threads have been created yet.
543 2001-12-12  NIIBE Yutaka  <gniibe@m17n.org>
545         * sysdeps/sh/pt-machine.h (INIT_THREAD_SELF): Added __volatile__
546         qualifier to be safe.
548 2001-11-30  Andreas Schwab  <schwab@suse.de>
550         * pthread.c (pthread_handle_sigcancel) [THREAD_SELF]: Double check
551         that self is the manager thread, and initialize the thread
552         register if not.
553         (thread_self_stack) [THREAD_SELF]: New function to find self via
554         stack pointer.
555         * manager.c (pthread_handle_create): Don't block cancel signal any
556         more.
558 2001-11-29  Andreas Jaeger  <aj@suse.de>
560         * sysdeps/x86_64/pt-machine.h: Use %gs as thread specific register.
561         (THREAD_SELF): New.
562         (INIT_THREAD_SELF): New.
563         (THREAD_GETMEM): New.
564         (THREAD_GETMEM_NC):
565         (THREAD_SETMEM): New.
566         (THREAD_SETMEM_NC): New.
567         (FLOATING_STACKS): Define.
568         (ARCH_STACK_MAX_SIZE): Define.
570 2001-11-28  Kaz Kylheku  <kaz@ashi.footprints.net>
572         Bugfix to pthread_key_delete. It was iterating over the thread
573         manager's linked list of threads, behind the thread manager's
574         back causing a race. The fix is to have the manager iterate over
575         the threads instead, using a new request type for doing so.
576         * internals.h (struct pthread_request): New manager request type
577         REQ_FOR_EACH_THREAD.
578         * manager.c (pthread_for_each_thread): New function.
579         (__pthread_manager): Handle new REQ_FOR_EACH_THREAD request.
580         * specific.c (struct pthread_key_delete_helper_args): New type.
581         (pthread_key_delete_helper): New static function.
582         (pthread_key_delete): Use the new thread manager
583         REQ_FOR_EACH_THREAD function to iterate over the threads and set
584         the delete key slot to a null value in each thread.
585         * Examples/ex18.c: New test.
586         * Makefile (tests): Add ex18.
588 2001-11-22  Wolfram Gloger  <wg@malloc.de>
590         * pthread.c (pthread_onexit_process): Don't call free
591         after threads have been asynchronously terminated.
593         * manager.c (pthread_handle_exit): Surround cancellation
594         of threads with __flockfilelist()/__funlockfilelist().
596 2001-11-26  Andreas Schwab  <schwab@suse.de>
598         * manager.c (pthread_handle_create): Start the child thread with
599         the cancel signal blocked, so that it does not handle it before
600         the thread register is set up.  Save errno from failed clone call.
602 2001-11-15  Ulrich Drepper  <drepper@redhat.com>
604         * sysdeps/i386/i686/Implies: Removed.
605         * sysdeps/i386/i686/Versions: New file.
607 2001-10-31  Andreas Jaeger  <aj@suse.de>
609         * sysdeps/x86_64/Makefile: Remove, we do not need it anymore.
611 2001-10-05  Kevin Buettner  <kevinb@cygnus.com>
613         * pthread.c (__linuxthread_pthread_sizeof_descr): Change name
614         to __linuxthreads_pthread_sizeof_descr to match name used by
615         symbol_list_arr[LINUXTHREADS_PTHREAD_SIZEOF_DESCR] in
616         linuxthreads_db/td_symbol_list.c.
618 2001-09-22  Andreas Jaeger  <aj@suse.de>
620         * linuxthreads/tst-context.c: Avoid compile warning.
622 2001-09-20  Andreas Jaeger  <aj@suse.de>
624         * shlib-versions: Add x86-64.
626 2001-09-19  Andreas Jaeger  <aj@suse.de>
628         * sysdeps/x86_64/Makefile: New file.
629         * sysdeps/x86_64/pspinlock.c: New file.
630         * sysdeps/x86_64/pt-machine.h: New file.
632 2001-09-12  Jakub Jelinek  <jakub@redhat.com>
634         * sysdeps/pthread/timer_delete.c (timer_delete): Thread may be NULL
635         for SIGEV_NONE.
636         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
638 2001-09-11  Ulrich Drepper  <drepper@redhat.com>
639             Wolfram Gloger <wg@malloc.de>
641         * join.c: Protect all communications from and to manager with
642         TEMP_FAILURE_RETRY.
643         * manager.c: Likewise.
644         * pthread.c: Likewise.
645         * smeaphore.c: Likewise.
647 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
649         * spinlock.c (__pthread_lock): Top max_count value with
650         MAX_ADAPTIVE_SPIN_COUNT.
651         * internals.h (MAX_ADAPTIVE_SPIN_COUNT): Define if not already done.
653         * sysdeps/i386/i686/pt-machine.h (BUSY_WAIT_NOP): New macro to
654         help P4.
656 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
658         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
659         non-opaque type if __USE_UNIX98.
661 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
663         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
664         non-opaque lock types also if _IO_MTSAFE_IO is defined.
666 2001-08-23  Roland McGrath  <roland@frob.com>
668         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start): Take
669         new first argument, skip the cleanup handler if it's zero.
670         (_LIBC_LOCK_RECURSIVE_INITIALIZER): New macro.
671         (__libc_lock_define_initialized_recursive): Use it.
672         * sysdeps/pthread/bits/stdio-lock.h: File removed.
673         The sysdeps/generic file from the main tree now suffices.
675 2001-08-22  Roland McGrath  <roland@frob.com>
677         * sysdeps/pthread/bits/stdio-lock.h: Include <bits/libc-lock.h>
678         instead of <pthread.h>.
679         (_IO_lock_t): Define this typedef using __libc_lock_define_recursive.
680         (_IO_lock_initializer): Add braces.
681         (_IO_lock_lock): Use __libc_lock_lock_recursive.
682         (_IO_lock_unlock): Use __libc_lock_unlock_recursive.
684         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_recursive_t): New type.
685         (__libc_lock_define_initialized_recursive): Use it.
686         (__libc_lock_init_recursive): Likewise.
687         (__libc_lock_fini_recursive): Likewise.
688         (__libc_lock_lock_recursive): Likewise.
689         (__libc_lock_trylock_recursive): Likewise.
690         (__libc_lock_unlock_recursive): Likewise.
691         (__libc_lock_define_recursive): New macro.
693 2001-08-14  Jakub Jelinek  <jakub@redhat.com>
695         * lockfile.c (__pthread_provide_lockfile): New variable.
696         * pthread.c (__pthread_require_lockfile): New variable.
697         * cancel.c (__pthread_require_lockfile): New variable.
699 2001-07-31  Ulrich Drepper  <drepper@redhat.com>
701         * tst-context.c (threadfct): Initialize context before calling
702         makecontext.
704         * Examples/ex17.c: Make sure test thread is around long enough.
706 2001-07-26  kaz Kojima  <kkojima@rr.iij4u.or.jp>
708         * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
710 2001-07-24  Ulrich Drepper  <drepper@redhat.com>
712         * tst-context.c (main): Print explanation before bailing out
713         because context handling is not supported.
715 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
717         * Makefile (tests): Add tst-context.
718         * tst-context.c: New file.
720         * sysdeps/pthread/bits/stdio-lock.h: Define
721         _IO_cleanup_region_start_noarg.
723 2001-07-23  Jakub Jelinek  <jakub@redhat.com>
725         * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
726         (ARCH_STACK_MAX_SIZE): Define.
727         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
728         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
730 2001-07-19  Jakub Jelinek  <jakub@redhat.com>
732         * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
734         * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
735         (ARCH_STACK_MAX_SIZE): Define.
736         * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
737         NEED_SEPARATE_REGISTER_STACK.
739 2001-07-16  Andreas Schwab  <schwab@suse.de>
741         * Makefile (before-compile): Don't add $(objpfx)crti.o.
742         (omit-deps): Add crti.
743         ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
744         it is filtered out of the link command.
746 2001-07-16  Ulrich Drepper  <drepper@redhat.com>
748         * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
749         to find the right value for __pthread_initial_thread_bos, it's not
750         used.  If not FLOATING_STACKS first run
751         __pthread_init_max_stacksize.
753 2001-06-16  H.J. Lu  <hjl@gnu.org>
755         * internals.h: Include <stackinfo.h>.
757         * attr.c: Don't include <stackinfo.h> here.
758         * cancel.c: Likewise.
759         * manager.c: Likewise.
760         * pthread.c: Likewise.
761         * ptlongjmp.c: Likewise.
763 2001-03-23  Matthew Wilcox  <willy@ldl.fc.hp.com>
765         * attr.c: Make _STACK_GROWS_UP work.
766         * internals.h: Likewise.
767         * manager.c: Likewise.
768         * pthread.c: Likewise.
770 2001-06-15  H.J. Lu  <hjl@gnu.org>
772         * pthread.c (__pthread_reset_main_thread): Fix a typo.
774 2001-02-02  John S. Marvin  <jsm@udlkern.fc.hp.com>
776         * semaphore.h: Use struct _pthread_fastlock as an element of
777         sem_t instead of an identical struct.
778         * rwlock.c: Remove casts.
779         * semaphore.c: Likewise.
781 2001-04-30  Alan Modra  <amodra@one.net.au>
783         * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
785 2001-05-25  Bruce Mitchener  <bruce@cubik.org>
787         * linuxthreads.texi: Spelling corrections.
789 2001-05-25  Ulrich Drepper  <drepper@redhat.com>
791         * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
792         returning successfully.
793         Patch by Gene Cooperman <gene@ccs.neu.edu>.
795 2001-05-24  Ulrich Drepper  <drepper@redhat.com>
797         * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
798         serious work try once whether the lock is uncontested.
799         Remove duplicate reading of __status before loop.
800         Change suggested by Hans Boehm <hans_boehm@hp.com>.
802         * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
803         (__pthread_alt_trylock): Likewise.
805 2001-05-01  Kaz Kylheku  <kaz@ashi.footprints.net>
807         Memory barrier overhaul following line by line inspection.
808         * mutex.c (pthread_once): Missing memory barriers added.
809         * pthread.c (__pthread_wait_for_restart_signal,
810         __pthread_timedsuspend_new, __pthread_restart_new): Added
811         memory barriers ``just in case'' and for documentary value.
812         * spinlock.c (__pthread_release): New inline function for releasing
813         spinlock, to complement __pthread_acquire.  Includes memory
814         barrier prior to assignment to spinlock, and __asm __volatile
815         dance to prevent reordering or optimization of the spinlock access.
816         * spinlock.c (__pthread_unlock, __pthread_alt_lock,
817         __pthread_alt_timedlock, __pthread_alt_unlock,
818         __pthread_compare_and_swap): Updated to use new __pthread_release
819         instead of updating spinlock directly.
820         * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
821         wait_node_free, wait_node_dequeue, __pthread_alt_lock,
822         __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
823         Memory barrier overhaul.  Lots of missing memory barriers added,
824         a couple needless ones removed.
825         * spinlock.c (__pthread_compare_and_swap): testandset optimization
826         removed, just calls __pthread_acquire, which has the new read
827         barrier in it before its testandset.
829 2001-05-20  Roland McGrath  <roland@frob.com>
831         * Makeconfig: New file, variables used to be in main libc Makeconfig.
833 2001-05-09  Geoff Keating  <geoffk@redhat.com>
835         * sysdeps/powerpc/pt-machine.h
836         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
837         (__compare_and_swap): Remove memory barriers.
838         (__compare_and_swap_with_release_semantics): New function.
840 2001-04-24  Andreas Jaeger  <aj@suse.de>
842         * wrapsyscall.c: send* and recv* return ssize_t.
844         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
845         mutex instead of double locking it.
846         Reported by Pierre Artaud <partaud@sodatec.com>.
848 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
850         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
851         using #ifdef whether the clock is available.
852         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
854         * sysdeps/ia64/Versions: New file.
856         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
857         have to call __gmon_start__ in the libpthread DSO.
858         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
860         * Makefile (libpthread-routines): Add ptclock_gettime and
861         ptclock_settime.
862         * internals.h: Don't use cpuclock-init.h definitions, use
863         hp-timing.h definitions.
864         * pthread.c: Likewise.
865         * manager.c: Likewise.
866         * ptclock_gettime.c: New file.
867         * ptclock_settime.c: New file.
868         * internals.h: Fix parameter type for __pthread_clock_gettime and
869         __pthread_clock_settime.
871         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
872         * sysdeps/i386/i586/ptclock_settime.c: Removed.
873         * sysdeps/i386/i586/Makefile: Removed.
875 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
877         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
878         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
880 2001-04-21  Andreas Jaeger  <aj@suse.de>
882         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
883         attribute, remove statements that will never be executed.
884         (thread_func): Remove mutex_unlock call since it's never executed.
885         (thread_func): Fix comment as suggested by Jakub Jelinek.
887         * manager.c (__pthread_manager): Add noreturn
888         attribute.
889         (pthread_start_thread): Likewise, remove return statement.
890         (pthread_start_thread_event): Likewise.
891         Add noreturn attribute for pthread_handle_exit.
892         * weaks.c: Add noreturn attribute for pthread_exit.
894         * internals.h: Add __pthread_clock_gettime and
895         __pthread_clock_settime prototypes.
897 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
899         * internals.h: Include <cpuclock-init.h>.
900         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
901         CPUCLOCK_VARDEF is defined.
902         * pthread.c (__pthread_initialize_minimal): Initialize
903         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
904         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
905         for new thread to current CPU clock value.
907         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
909         * sysdeps/i386/i586/Makefile: New file.
910         * sysdeps/i386/i586/Versions: New file.
911         * sysdeps/i386/i586/ptclock_gettime.c: New file.
912         * sysdeps/i386/i586/ptclock_settime.c: New file.
913         * sysdeps/i386/i686/Implies: New file.
915 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
917         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
918         $generated, not $postclean-generated.
920 2001-04-18  Andreas Jaeger  <aj@suse.de>
922         * Makefile (otherlibs): Added.
924 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
926         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
928 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
930         * signals.c (sigwait): NSIG is no signal number.  Block all
931         signals while in signal handler for signals in SET.
932         Patch by Manfred Spraul <manfred@colorfullife.com>.
934 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
936         * tst-cancel.c: Disable most tests.  Add new test where all
937         cleanup handlers must run.
938         * Makefile (tests): Add tst-cancel again.
940         * cancel.c (__pthread_perform_cleanup): Correct condition for
941         leaving cleanup loop early.
943         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
944         all the files which use CURRENT_STACK_FRAME.
945         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
946         __builtin_frame_address.
947         * sysdeps/i386/i686/pt-machine.h: Likewise.
949 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
951         * Makefile (tests): Comment out tst-cancel for now.
953         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
954         temporary file in object directory.
955         * Makefile: Don't allow inlining when compiling tst-cancel.c.
956         Pass $(objpfx) to tst-cancel.
958 2001-04-11  David S. Miller  <davem@redhat.com>
960         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
961         up closer to user local variables so that new cleanup heuristics work.
962         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
964 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
966         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
967         and remove it.
968         (_pthread_cleanup_push_defer): Likewise.
970         * tst-cancel.c (main): Fix loop printing cleanup output.
972 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
974         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
975         test.
976         (__pthread_spin_trylock): Likewise.
977         * sysdeps/sh/pt-machine.h (testandset): Likewise.
979 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
981         * join.c (pthread_exit): Move code to new function __pthread_do_exit
982         which takes an extra parameter with the current frame pointer.
983         Call new function with CURRENT_STACK_FRAME.
984         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
985         with the new parameter.
986         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
987         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
988         this parameter as the initial value the cleanup handler records are
989         compared against.  No active cleanup handler record must have an
990         address lower than the previous one and the initial record must be
991         above (below on PA) the frame address passed in.
992         (pthread_setcancelstate): Call __pthread_do_exit instead of
993         pthread_exit.
994         (pthread_setcanceltype): Likewise.
995         (pthread_testcancel): Likewise.
996         (_pthread_cleanup_pop_restore): Likewise.
997         * condvar.c (pthread_cond_wait): Likewise.
998         (pthread_cond_timedwait_relative): Likewise.
999         * manager.c (pthread_start_thread): Likewise.
1000         * oldsemaphore.c (__old_sem_wait): Likewise.
1001         * pthread.c (pthread_handle_sigcancel): Likewise.
1002         * semaphore.c (__new_sem_wait): Likewise.
1003         (sem_timedwait): Likewise.
1004         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
1005         to limit the cleanup handlers which get run.
1006         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
1007         for __pthread_perform_cleanup.
1009         * Makefile (tests): Add tst-cancel.
1010         * tst-cancel.c: New file.
1012 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
1014         * sysdeps/cris/pt-machine.h: New file.
1015         * sysdeps/cris/pspinlock.c: New file.
1017 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
1019         * shlib-versions: Add case for Linux on CRIS.
1021 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
1023         * attr.c (pthread_getattr_np): Correct computation of stack size
1024         for machiens with register stack.
1026         * Examples/ex17.c (main): Correct detection of failed mmap call.
1028 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1030         * pthread.c (__pthread_initialize_manager): Fix a typo.
1032 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
1034         * attr.c (__pthread_attr_setstack): Fix alignment check.
1035         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
1036         * Makefile (tests): Add ex17 test.
1037         * Examples/ex17.c: New test.
1039 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
1041         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
1042         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
1043         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
1045 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
1047         * Makefile: When generating DSO link with libc_nonshared.a.
1049 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
1051         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
1053 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
1055         * internals.h (__pthread_init_max_stacksize): New prototype.
1056         * attr.c (__pthread_attr_setstacksize): Call
1057         __pthread_init_max_stacksize if not yet initialized.
1058         * pthread.c (__pthread_init_max_stacksize): New function.
1059         (__pthread_initialize_manager): Call it.
1060         Patch by <dtc@cmucl.cons.org>.
1062 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
1064         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
1066 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1068         * shlib-versions: Add rule for Linux on 64 bit S/390.
1069         * sysdeps/s390/s390-64/pt-machine.h: New file.
1070         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
1072 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1074         * sysdeps/s390/pt-machine.h: Move to...
1075         * sysdeps/s390/s390-32/pt-machine.h: ...here.
1076         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
1078 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
1080         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
1081         * attr.c: Implement pthread_getattr_np.
1082         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
1083         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
1084         * manager.c (pthread_handle_create): Initialize p_inheritsched.
1086 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1088         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
1089         code alignment.
1091 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
1093         * manager.c (manager_mask): Removed static vesion.  Now always local
1094         to __pthread_manager().
1095         (manager_mask_all): Removed completely.
1096         (__pthread_manager): Remove manager_mask_all initialization.
1097         (pthread_handle_create): Remove code to set and reset signal mask
1098         around __clone2() calls.
1100 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
1102         * spinlock.c (__pthread_lock): Force lock->__status to be read from
1103         memory on every spin.
1105 2001-02-10  Andreas Jaeger  <aj@suse.de>
1107         * Makefile (extra-objs): New.
1109 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
1111         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
1112         __pthread_initialize_minimal prototype.
1114 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1116         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
1118 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1120         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
1122 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
1124         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
1125         broken code.  Patch by Jes Sorensen.
1127 2001-02-06  Andreas Jaeger  <aj@suse.de>
1129         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
1130         to...
1131         * internals.h: ...here.
1133 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
1135         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1137 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
1139         * Versions: Remove __pthread_initialize_minimal.
1141 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
1143         * Makefile: Add rules to build crti.o and make it being used in
1144         building libpthread.so.
1145         * sysdeps/i386/Makefile: New file.
1146         * sysdeps/pthread/pt-initfini.c: New file.
1148         * pthread.c: Cleanups.
1150 2001-01-28  Andreas Jaeger  <aj@suse.de>
1152         * oldsemaphore.c (__old_sem_init): Adjust for last change.
1153         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1154         * spinlock.c: Likewise.
1156 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
1158         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
1159         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
1160         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
1161         * pthread.c: Likewise.
1162         * spinlock.h: Likewise.
1163         * sysdeps/pthread/pthread.h: Likewise.
1165 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
1167         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
1168         as struct __pthread_attr_s.
1170         * semaphore.h (sem_t): Cleanup namespace, rename status and
1171         spinlock elements.
1173 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
1175         * pthread.c (pthread_onexit_process): Clear
1176         __pthread_manager_thread_bos after freeing it.
1177         * Makefile (tests): Add ex16.
1178         * Examples/ex16.c: New file.
1180 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1182         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
1183         -z nodelete.
1184         * pthread.c (pthread_exit_process): Rename to...
1185         (pthread_onexit_process): ...this.
1186         (pthread_atexit_process, pthread_atexit_retcode): New.
1187         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
1188         and only if HAVE_Z_NODELETE is not defined.
1189         (__pthread_initialize_manager): Register pthread_atexit_retcode
1190         with __cxa_atexit.
1192 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
1194         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
1196 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
1198         * Makefile (tests): Add ex15.
1199         * Examples/ex15.c: New test.
1201 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
1203         * pthread.c (pthread_exit_process): Free memory allocated for
1204         manager stack.
1206 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1208         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
1209         (pthread_free): Always unmap the stack.  It's safe now that we don't
1210         use MAP_FIXED to allocate stacks.
1212 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
1214         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
1216         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
1218 2000-11-15  Wolfram Gloger  <wg@malloc.de>
1220         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
1221         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
1223 2000-12-27  Andreas Jaeger  <aj@suse.de>
1225         * Examples/ex13.c: Make local functions static.
1226         * ecmutex.c: Likewise.
1227         * joinrace.c: Likewise.
1228         * Examples/ex14.c: Likewise.
1230         * Examples/ex2.c: Make local functions static; reformat.
1231         * Examples/ex1.c: Likewise.
1232         * Examples/ex4.c: Likewise.
1233         * Examples/ex5.c: Likewise.
1234         * Examples/ex7.c: Likewise.
1236         * oldsemaphore.c: Add prototypes to shut up GCC.
1237         * pt-machine.c: Likewise.
1239         * weaks.c: Add prototype for pthread_exit.
1241         * internals.h: Add some prototypes, format prototypes and add
1242         missing externs.
1243         Move __libc_waitpid prototype to include/sys/wait.h.
1245         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
1246         * mutex.c: Likewise.
1247         * specific.c: Likewise.
1248         * ptfork.c: Likewise.
1250         * lockfile.c: Include internals.h to get prototypes.
1251         * events.c: Likewise.
1252         * sysdeps/alpha/pspinlock.c: Likewise.
1253         * sysdeps/arm/pspinlock.c: Likewise.
1254         * sysdeps/hppa/pspinlock.c: Likewise.
1255         * sysdeps/i386/pspinlock.c: Likewise.
1256         * sysdeps/ia64/pspinlock.c: Likewise.
1257         * sysdeps/m68k/pspinlock.c: Likewise.
1258         * sysdeps/mips/pspinlock.c: Likewise.
1259         * sysdeps/powerpc/pspinlock.c: Likewise.
1260         * sysdeps/s390/pspinlock.c: Likewise.
1261         * sysdeps/sh/pspinlock.c: Likewise.
1262         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
1263         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
1264         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
1266 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
1268         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
1269         (__pthread_attr_getstack): Return correct address.
1270         Add warnings for using pthread_attr_getstackaddr and
1271         pthread_attr_setstackaddr.
1273 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
1275         * Examples/ex6.c (test_thread): Make static.
1276         * Examples/ex12.c (test_thread): Make static and add noreturn
1277         attribute.
1279 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
1281         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
1282         and compare_and_swap_with_release_semantics returns int not long.
1284 2000-12-17  Andreas Jaeger  <aj@suse.de>
1286         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
1287         value.
1288         * sysdeps/arm/pt-machine.h (testandset): Likewise.
1289         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
1290         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
1291         * sysdeps/sh/pt-machine.h (testandset): Likewise.
1292         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
1293         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
1295 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
1297         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
1298         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
1300 2000-12-17  Andreas Jaeger  <aj@suse.de>
1302         * internals.h: Add prototypes for testandset and
1303         __compare_and_swap to shut up gcc warnings.
1305 2000-12-06  Wolfram Gloger  <wg@malloc.de>
1307         * join.c (pthread_detach): Allow case where the thread has already
1308         terminated.
1310 2000-12-05  Andreas Jaeger  <aj@suse.de>
1312         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
1313         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1314         (__compare_and_swap): Likewise.
1315         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
1317 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
1319         * Examples/ex3.c (main): Cast int to long before casting to void *.
1320         (search): Cast void * to long, not int.
1321         * Examples/ex8.c (main, thread): Similarly.
1322         * Examples/ex11.c (main): Similarly.
1323         * Examples/ex14.c (worker, do_test): Similarly.
1324         * ecmutex.c (worker, do_test): Similarly.
1325         (nlocks): Cast to int.
1327 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
1329         * linuxthreads.texi:  Add documentation for pthreads attributes
1330         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
1331         patch.  Document pthread_[sg]etconcurrency().  Mark
1332         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
1334 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
1336         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1337         Don't define it.
1338         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1339         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
1341 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
1343         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
1344         not doing it right now.
1345         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
1347 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
1349         * Examples/ex4.c (main): Don't use exit() to avoid warning with
1350         broken compilers.
1352 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
1354         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
1355         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
1357         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
1358         discussing mutexes. (As per the Unix98 name for the API.)
1359         Changes documentation for pthread_mutexattr_setkind_np() and
1360         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
1361         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
1362         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
1363         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
1364         Begins to introduce discussion of the ``timed'' mutex type.  This
1365         discussion is currently incomplete.
1366         Patch by Bruce Mitchener <bruce@cubik.org>.
1368 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
1369             Yutaka Niibe  <gniibe@chroot.org>
1371         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
1372         has restrictions, use register.
1374 2000-10-23  Andreas Schwab  <schwab@suse.de>
1376         * Examples/ex14.c (TIMEOUT): Override default timeout.
1378 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
1380         * specific.c: Protect tsd array modification in thread data
1381         structures by getting the thread lock in pthread_key_delete and
1382         __pthread_destroy_specifics.
1383         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
1385 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1387         * sysdeps/pthread/bits/initspin.h: New file.
1388         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
1389         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
1390         (__pthread_alt_init_lock): Likewise.
1391         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
1393 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
1395         * oldsemaphore.c (__old_sem_init): Release lock with
1396         LT_SPINLOCK_INIT, not zero.
1397         * spinlock.c (__pthread_unlock): Likewise.
1398         (__pthread_alt_lock): Likewise.
1399         (__pthread_alt_timedlock): Likewise.
1400         (__pthread_alt_unlock): Likewise.
1401         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
1402         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
1403         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
1404         LT_SPINLOCK_INIT do initialize spinlocks not 0.
1406 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
1408         * shlib-versions: Add version definitions for hppa-linux.
1410 2000-10-12  Alan Modra <alan@linuxcare.com.au>
1412         * sysdeps/hppa/pspinlock.c: New file.
1413         * sysdeps/hppa/pt-machine.h: New file.
1414         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
1416 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
1418         * mutex.c (__pthread_mutex_destroy): Correct test of
1419         busy mutex for mutexes using alternate fastlocks.
1420         Patch by dtc@cmucl.cons.org.
1422 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
1424         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
1426 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
1428         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
1429         test for owner first.
1430         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1432         * cancel.c (pthread_cancel): Don't do anything if cancelation is
1433         disabled.
1435 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
1437         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
1438         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1440         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
1441         _POSIX_MONOTONIC_CLOCK.
1443         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
1444         and explain why.
1446 2000-09-20  Andreas Jaeger  <aj@suse.de>
1448         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
1449         "testrtsig.h" conditional.
1451 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
1453         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
1454         pthread_attr_setstack.
1455         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
1456         pthread_attr_setstack.
1457         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
1459 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
1461         * Examples/ex14.c: New file.
1462         * Makefile (tests): Add ex14.
1464         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
1465         mutex.  Patch by dtc@cmucl.cons.org.
1467         * ecmutex.c: New file.
1468         * Makefile (tests): Add ecmutex.
1470 2000-09-04  H.J. Lu  <hjl@gnu.org>
1472         * attr.c (__pthread_attr_setguardsize): Use page_roundup
1473         instead of roundup to round up to the page size.
1475 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
1477         * manager.c (pthread_exited): Correctly report event as TD_REAP
1478         instead of TD_DEATH.  Fix comments.
1480 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
1482         * spinlock.h (testandset): Add cast to avoid warning.
1483         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
1485 2000-09-02  Andreas Jaeger  <aj@suse.de>
1487         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
1488         prototype.
1490 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
1492         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1493         Fix typo in last patch (_mode -> _flags).
1495         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
1496         Provide definition which respects _IO_USER_LOCK flag.
1498 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
1500         * manager.c (pthread_allocate_stack): Clear descriptor only if not
1501         mmaped.
1503 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
1505         * Makefile: Add rules to build and run unload.
1506         * unload.c: New file.
1508         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
1510         * sysdeps/pthread/pthread.h
1511         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
1512         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
1514 2000-08-24  Andreas Jaeger  <aj@suse.de>
1516         * Examples/ex13.c: Include <string.h> for strerror prototype and
1517         <stdlib.h> for abort prototype.
1518         (pthr_cond_signal_mutex): Rewrite to silence GCC.
1519         (thread_start): Remove unused variable err.
1520         (main): Silence GCC warnings.
1522 2000-08-22  Andreas Jaeger  <aj@suse.de>
1524         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
1526         * Makefile (tests): Add ex13.
1528 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
1530         * semaphore.h: Add restrict where required by AGd4.
1531         * sysdeps/pthread/pthread.h: Likewise.
1532         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
1534 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
1536         * Makefile (tests): Add ex12.  Add rule to build it.
1537         * Examples/ex12.c: New file.
1539 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
1541         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
1542         even though the implementation is not quite complete (but it reports
1543         it).  Define _POSIX_MESSAGE_PASSING to -1.
1544         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1546 2000-08-12  Andreas Jaeger  <aj@suse.de>
1548         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
1549         assembler.
1550         (__compare_and_swap): Likewise.
1551         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
1553 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
1555         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
1556         p_h_errnop correctly and not to NULL.
1558 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
1560         * Banner: Bump version number to 0.9.
1562 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
1564         * Makefile (tests): Add tststack.  Add rule to build the program.
1565         * tststack.c: New file.
1567         * internals.h: Declare __pthread_max_stacksize.
1568         * pthread.c (__pthread_max_stacksize): New variable.
1569         (__pthread_initialize_manager): Determine __pthread_initialize_manager
1570         value.
1571         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
1572         (pthread_allocate_stack): Allow kernel to choose stack address if
1573         FLOATING_STACKS.  This also handles variable-sized stacks.
1574         Always allocate stack and guardpage together.  Use mprotect to
1575         change guardpage access.
1576         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
1577         ARCH_STACK_MAX_SIZE.
1579         * attr.c (__pthread_attr_setstacksize): Also test value against
1580         upper limit.
1582         * manager.c (__pthread_nonstandard_stacks): Define only if
1583         THREAD_SELF is not defined.
1584         (pthread_allocate_stack): Always initialize gardaddr to a correct
1585         value.
1586         (pthread_handle_create): Unmap thread with one call.
1587         (pthread_free): Remove test for initial thread before removing stack.
1588         Unmap stack with one call.
1590         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
1591         1 to avoid removing the stack.
1593 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
1595         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
1596         load of spin lock to prime the cache before the atomic compare and
1597         exchange operation (cmpxchg4). This avoids the spinning on the
1598         cmpxchg4 instruction and reduces movement of the cache line back
1599         and forth between the processors (explanation by Asis K. Mallick
1600         from Intel). This basically makes the implementation operate the
1601         same as the Linux kernel implementation.
1603         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
1604         * sysdeps/ia64/pspinlock.c: New file.
1606 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
1608         * pthread.c: Move definition of __pthread_set_own_extricate_if...
1609         * spinlock.h: ...here.  Remove locking.
1610         * internals.h: Remove __pthread_set_own_extricate_if prototype.
1612         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
1613         (rwlock_rd_extricate_func): Don't determine self, let
1614         __pthread_lock do it.
1615         (rwlock_wr_extricate_func): Likewise.
1616         (rwlock_have_already): Optimize *pself handling a bit.
1618         * mutex.c: Use __builtin_expect.
1619         * pthread.c: Likewise.
1621 2000-08-02  Andreas Jaeger  <aj@suse.de>
1623         * sysdeps/s390/pspinlock.c: New file.
1624         * sysdeps/s390/pt-machine.h: New file.
1625         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
1627 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1629         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
1630         R3K.
1631         * sysdeps/mips/pt-machine.h (testandset): Likewise.
1633 2000-07-26  Andreas Jaeger  <aj@suse.de>
1635         * pthread.c: Initialize p_sem_avail.
1637 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
1639         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
1640         * semaphore.c: Handle spurious wakeups.
1642         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
1643         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
1645         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
1646         (__pthread_wait_for_restart): Likewise.
1648         * condvar.c (pthread_cond_wait): Also check whether thread is
1649         cancelable before aborting loop.
1650         (pthread_cond_timedwait): Likewise.
1652         * signals.c (pthread_sighandler): Remove special code to restrore
1653         %gs on x86.
1654         (pthread_sighandler_t): Likewise.
1656 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
1658         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
1659         * pthread.c: Include <resolv.h>.
1660         (_res): Undefine.  Add extern declaration.
1662 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
1664         * pthread.c (__pthread_initial_thread): Update initializer.
1665         (__pthread_manager_thread): Likewise.
1666         (pthread_initialize): Move setrlimit call to...
1667         (__pthread_initialize_manager): ...here.
1668         (__pthread_reset_main_thread): Reset also soft limit on stack size.
1670         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
1671         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
1673 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
1675         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
1676         __compare_and_swap to define testandset.
1677         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
1678         Define IMPLEMENT_TAS_WITH_CAS.
1680 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
1682         * Makefile: Pass -z nodelete to linker for libpthread.so
1683         generation if it understand this option.
1685 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
1687         * manager.c (pthread_handle_create): Remove initialization of
1688         new_thread->p_res._sock.
1690 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
1692         Bugfixes to the variant of the code for machines with no compare
1693         and swap.
1695         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
1696         node was not being properly enqueued, due to failing to update
1697         the lock->__status field.
1699         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
1700         being set inappropriately, causing the suspend function to be called
1701         with a null self pointer and crash.
1703 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
1705         * spinlock.h (__pthread_alt_trylock): Fix code used if no
1706         compare&swap is available.
1708         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
1709         compare_and_swap.
1711         * pthread.c (pthread_initialize): Don't use sysconf to determine
1712         whether the machine has more than one processor.
1714         * spinlock.c (__pthread_alt_timedlock): Add back one of the
1715         removed thread_self calls.
1717 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1719         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
1720         __compare_and_swap to compare_and_swap in code which assumes
1721         compare swap is available.
1723 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
1725         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
1726         bug whereby thr field of waitnode structure would not be correctly
1727         set unless a null self pointer is passed to the functions.
1728         Eliminated redundant calls to thread_self().
1730 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
1732         * pthread.c (__pthread_initialize_manager): Lock
1733         __pthread_manager_thread.p_lock before calling clone.
1735 2000-05-05  H.J. Lu  <hjl@gnu.org>
1737         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1738         have acquire semantics.
1739         (__compare_and_swap_with_release_semantics): New inline
1740         function.
1741         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1743 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
1745         * manager.c: Fix the problem with signals at startup.
1746         Change the way that thread stacks are allocated on IA64.
1747         Clean up some of the guard page allocation stuff.
1749 1999-12-19  H.J. Lu  <hjl@gnu.org>
1751         * internals.h (page_roundup): New.
1752         * attr.c (__pthread_attr_setguardsize); Use page_roundup
1753         instead of roundup.
1754         * manager.c (pthread_allocate_stack): Make sure guardaddr is
1755         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1756         is define.
1758 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
1760         * manager.c (pthread_allocate_stack): Unmap the stack top
1761         if failed to map the stack bottom.
1762         Fix the guard page.
1763         (pthread_free): Fix the guard page.
1765         * pthread.c (pthread_initialize): Set rlimit correctly for
1766         NEED_SEPARATE_REGISTER_STACK.
1768 1999-12-16  H.J. Lu  <hjl@gnu.org>
1770         * pthread.c (__pthread_initialize_manager): Pass
1771         __pthread_manager_thread_bos instead of
1772         __pthread_manager_thread_tos to __clone2.
1774 1999-12-16  H.J. Lu  <hjl@gnu.org>
1776         * manager.c (pthread_allocate_stack): Correct the calculation
1777         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1778         stack bottom.
1780 1999-12-13  H.J. Lu  <hjl@gnu.org>
1782         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
1783         bit after setting ar.ccv.
1785 1999-12-12  H.J. Lu  <hjl@gnu.org>
1787         * manager.c (pthread_allocate_stack): Make the starting
1788         address of the stack bottom page aligned. FIXME: it may
1789         need changes in other places.
1790         (pthread_handle_create): Likewise.
1792 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
1794         * manager.c (pthread_allocate_stack): Handle
1795         NEED_SEPARATE_REGISTER_STACK.
1796         (pthread_handle_create): Likewise.
1797         * pthread.c (__pthread_initialize_manager): Likewise.
1799         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
1801 1999-12-02  H.J. Lu  <hjl@gnu.org>
1803         * sysdeps/ia64/pt-machine.h: New.
1805 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
1807         * wrapsyscall.c: Mark non-__ protected names as weak.
1808         PR libc/1466.
1810 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
1812         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
1814 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
1816         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
1817         Add tests also to new alternative spinlock implementation.
1818         * spinlock.h: Likewise.
1819         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1821 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
1823         * Version: Export __sigaction.
1824         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
1825         of __sigaction.
1826         * pthread.c: Use __libc_sigaction instead of __sigaction.
1828         * condvar.c: Implement pthread_condattr_getpshared and
1829         pthread_condattr_setpshared.
1830         * mutex.c: Implement pthread_mutexattr_getpshared and
1831          pthread_mutexattr_setpshared.
1832         * Versions: Export new functions.
1833         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1835         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
1836         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
1837         is not selected.
1839 2000-07-04  Greg McGary  <greg@mcgary.org>
1841         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
1842         pragmas.  Include bp-sym.h only if _LIBC.
1844 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
1846         * spinlock.c (__pthread_unlock): Properly place write barrier.
1847         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1849 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
1851         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
1852         faster on SMP systems.  No more emulation of compare&swap for adaptive
1853         spinlocks.
1854         * spinlock.h: Likewise.
1855         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
1856         Replace fast with adaptive mutex.
1857         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
1858         * condvar.c: Likewise.
1859         * pthread.c: Define and initialize __pthread_smp_kernel variable.
1860         * internals.h: Declare __pthread_smp_kernel.
1861         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
1862         _pthread_fastlock structure.
1863         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1865         * pthread.c: Remove initialization to zero from global variables.
1867 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
1869         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
1871 2000-06-28  Greg McGary  <greg@mcgary.org>
1873         * weaks.c: Wrap BP_SYM () around weak extern declarations of
1874         pthread functions that have pointers in their return+arg signatures.
1876 2000-06-27  Greg McGary  <greg@mcgary.org>
1878         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
1879         extern declarations of pthread functions that have pointers in
1880         their return+arg signatures.
1882 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
1884         * Makefile (tests): Add ex11.  Add rules to build it.
1885         * Examples/ex11.c: New file.
1886         * rwlock.c: Fix complete braindamaged previous try to implement
1887         timedout functions.
1889         * spinlock.c: Pretty print.
1891 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
1893         * Makefile (tests): Add ex10.  Add rules to build it.
1894         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
1895         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
1896         * condvar.c (pthread_cond_wait): Allow mutex of kind
1897         PTHREAD_MUTEX_TIMED_NP.
1898         (pthread_cond_timedwait_relative): Likewise.
1899         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
1900         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
1901         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1902         (__pthread_mutex_lock): Use __pthread_alt_lock for
1903         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1904         (__pthread_mutex_timedlock): New function.
1905         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
1906         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1907         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
1908         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
1909         * spinlock.c: Implement alternate fastlocks.
1910         * spinlock.h: Add prototypes.
1911         * Examples/ex10.c: New file.
1912         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1913         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1915         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
1916         (__pthread_rwlock_timedrdlock): New function.
1917         (__pthread_rwlock_timedwrlock): New function.
1918         Use laternate fastlock function everywhere.
1920 2000-06-21  Andreas Jaeger  <aj@suse.de>
1922         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
1923         prototype.
1925         * join.c: Include <stdlib.h> for exit prototype.
1927 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
1929         * sysdeps/i386/useldt.h: Include <stdlib.h>.
1931         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
1932         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1934         * Makefile (libpthread-routines): Add barrier.
1935         (tests): Add ex9.  Add rule to build ex9.
1936         * Versions: Export barrier functions.
1937         * barrier.c: New file.
1938         * Examples/ex9.c: New file.
1939         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
1940         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
1941         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1943 2000-06-19  H.J. Lu  <hjl@gnu.org>
1945         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
1946         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
1947         (compare_and_swap_with_release_semantics): New. Default to
1948         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
1949         is not defined.
1951         * spinlock.c (__pthread_unlock): Call
1952         compare_and_swap_with_release_semantics () instead of
1953         compare_and_swap ().
1955 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
1957         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
1958         to errno directly.
1959         * sysdeps/pthread/timer_delete.c: Likewise.
1960         * sysdeps/pthread/timer_getoverr.c: Likewise.
1961         * sysdeps/pthread/timer_gettime.c: Likewise.
1962         * sysdeps/pthread/timer_settime.c: Likewise.
1964 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
1966         Timer nodes are now reference counted, and can be marked
1967         as deleted. This allows for the safe release of the global mutex
1968         in the middle without losing the timer being operated on.
1970         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
1971         member is now an enum with three values, so that an intermediate
1972         state can be represented (deleted but not free for reuse yet).
1973         New refcount member added.
1974         * sysdeps/pthread/timer_routines.c: Likewise.
1976         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
1977         timer_valid): New inline functions added.
1979         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
1980         restructured, recursive deadlock bug fixed.
1982         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
1983         timer_addref to ensure that timer won't be deleted while mutex is not
1984         held. Also uses timer_invalid to perform validation of timer handle.
1985         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
1986         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
1988 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
1990         * shlib-versions: Add entry for SH.
1991         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
1993 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
1995         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
1996         tightened up some critical regions and micro-optimized some list
1997         manipulation code.
1999         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2000         Returns int value now to indicate whether timer was queued at head.
2001         * sysdeps/pthread/posix-timer.h: Likewise.
2002         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
2003         new return value from __timer_thread_queue_timer to avoid waking
2004         up timer thread unnecessarily.
2006         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
2007         inuse flag, because this requires mutex to be held.  Callers updated
2008         to do the check when they have the mutex.
2009         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
2011         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
2012         regions: avoids making system calls while holding timer mutex, and
2013         a few computations were moved outside of the mutex as well.
2014         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
2016         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
2017         to list_unlink_ip, meaning idempotent.  Pointer manipulation
2018         changed to get better better code out of gcc.
2019         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
2020         version of list_unlink added here.
2021         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
2022         function in all places: idempotent one for timers, non-idempotent
2023         one for thread nodes.
2024         * sysdeps/pthread/timer_settime: Likewise.
2025         * sysdeps/pthread/timer_routines.c: Likewise.
2027 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
2029         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
2030         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2032         * sysdeps/pthread/Makefile: Remove tests definition.
2034 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
2035             Yutaka Niibe  <gniibe@chroot.org>
2037         * sysdeps/sh/pspinlock.c: New file.
2038         * sysdeps/sh/pt-machine.h: New file.
2040 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
2042         * Makefile (tests): Add joinrace.
2044         * Examples/ex6.c: Test return value of pthread_join.
2046 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
2048         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
2049         (__pthread_spin_trylock): Implement.
2050         (__pthread_spin_unlock): Implement.
2051         (__pthread_spin_init): Implement.
2052         (__pthread_spin_destroy): Implement.
2054 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2056         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
2057         really append the entry.
2059 2000-06-10  Andreas Jaeger  <aj@suse.de>
2061         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
2063 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
2065         * sysdeps/pthread/timer_create.c: Thread matching now done on
2066         clock type as well as thread attributes.
2067         There are individual global signal-delivering threads for
2068         different clock types.
2069         * sysdeps/pthread/posix-timer.h: Likewise.
2070         * sysdeps/pthread/timer_routines.c: Likewise.
2072         * sysdeps/pthread/timer_routines.c: Thread allocation and
2073         deallocation function now remembers to put thread on active
2074         list and remove from active list.
2075         Thus now the feature of binding multiple timers
2076         to a single thread actually works.
2078 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
2080         * pthread.c (__pthread_create_2_1): Optimize a bit.
2082         * internals.h (invalid_handle): Also test for p_terminated != 0.
2083         (nonexisting_handle): New function.  Same as old invalid_handle.
2084         * join.c (pthread_join): Use nonexisting_handle instead of
2085         invalid_handle to test for acceptable thread handle.
2086         * manager.c (pthread_handle_free): Likewise.
2087         * joinrace.c: New file.
2088         Reported by Permaine Cheung <pcheung@cygnus.com>.
2090 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2092         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2093         Correct handling of matching variable.
2095         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
2096         avoid warnings.
2098         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
2099         Be prepared for empty timer list.
2101         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
2102         CPUTIME clock ID.  Add support for thread clocks.
2104         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
2105         subtraction were switched.
2107         * sysdeps/pthread/timer_routines.c (init_module): Use
2108         THREAD_MAXNODES threads.
2110         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
2111         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
2112         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
2113         with sigqueueinfo is this system call is available.
2115         * sysdeps/pthread/timer_create.c (timer_create): Allow
2116         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
2118         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
2119         functionality.
2120         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
2122 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2124         * sysdeps/pthread/posix-timer.h: New file.
2125         * sysdeps/pthread/timer_create.c: New file.
2126         * sysdeps/pthread/timer_delete.c: New file.
2127         * sysdeps/pthread/timer_getoverr.c: New file.
2128         * sysdeps/pthread/timer_gettime.c: New file.
2129         * sysdeps/pthread/timer_routines.c: New file.
2130         * sysdeps/pthread/timer_settime.c: New file.
2131         * sysdeps/pthread/tst-timer.c: New file.
2133 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
2135         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
2136         LINK_MAX definitions if necessary.
2138 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
2140         Added missing fork time handling of global libio lock.
2142         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
2143         not just the individual stream locks. Rewritten to use new
2144         iterator interface provided by libio rather than accessing
2145         global variable.
2147         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
2148         which lock and unlock the stream list using the new interface
2149         provied by libio.
2150         * internals.h: Likewise.
2152         * ptfork.c (__fork): Now calls __flockfilelist before fork,
2153         and __funlockfilelist in the parent after the fork.
2154         Child still calls __fresetlockfiles as before.
2156         * linuxthreads.texi: Now explains what happens to streams at
2157         fork time. Also whole new section on forking and thread added.
2158         Definition of pthread_atfork moved out of Miscellaneous Functions
2159         to this new section.
2161 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
2163         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
2164         Add missing register.
2165         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
2167 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
2169         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
2170         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
2171         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
2173 2000-05-31  Andreas Jaeger  <aj@suse.de>
2175         * sysdeps/mips/pspinlock.c: Implement spinlocks.
2177 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
2179         * spinlock.c (__pthread_lock): Remove ASSERT.
2181         * Makefile (tests): Add ex8.
2182         * Examples/ex8.c: New file.
2184 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
2186         Bugfix: The pthread_atfork mechanism now takes care of its
2187         own internal mutex at fork time.
2189         * ptfork.c (__fork): Revised so that the mutex is held across
2190         the fork operation and while the handlers are called, and so that
2191         the child resets the mutex.
2193         * linuxthreads.texi: Updated pthread_atfork documentation to make
2194         it clear that fork and pthread_atfork can't be reentered from
2195         atfork handlers, that pthread_atfork and fork are mutually atomic,
2196         and that the handlers are inherited by the child process.
2198 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
2200         * Makefile (libpthread-routines): Add pspinlock.
2201         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
2202         Use struct _pthread_fastlock instead of pthread_spinlock_t.
2203         * condvar.c: Likewise.
2204         * internals.h: Likewise.
2205         * join.c: Likewise.
2206         * manager.c: Likewise.
2207         * mutex.c: Likewise.
2208         * pthread.c: Likewise.
2209         * rwlock.c: Likewise.
2210         * semaphore.c: Likewise.
2211         * signals.c: Likewise.
2212         * spinlock.h: Likewise.
2213         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
2214         * sysdeps/alpha/pspinlock.c: New file.
2215         * sysdeps/arm/pspinlock.c: New file.
2216         * sysdeps/i386/pspinlock.c: New file.
2217         * sysdeps/m68k/pspinlock.c: New file.
2218         * sysdeps/mips/pspinlock.c: New file.
2219         * sysdeps/powerpc/pspinlock.c: New file.
2220         * sysdeps/sparc/sparc32/pspinlock.c: New file.
2221         * sysdeps/sparc/sparc64/pspinlock.c: New file.
2222         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
2223         back to _pthread_fastlock.  Define new pthread_spinlock_t.
2225 2000-05-24  Andreas Jaeger  <aj@suse.de>
2227         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
2229 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
2231         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
2233 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
2235         * internals.h (__RES_PTHREAD_INTERNAL): Define.
2237 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2239         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
2240         object state is represented with additional bits which distinguish
2241         whether that state was set up in the current process, or
2242         in an ancestor process. If that state was set in an ancestor,
2243         it means that a fork happened while thread was executing the init
2244         function. In that case, the state is reset to NEVER.
2245         * mutex.c (__pthread_once_fork_prepare): New function.
2246         (__pthread_once_fork_child): Likewise
2247         (__pthread_once_fork_parent): Likewise
2248         (__pthread_reset_pthread_once): Removed.
2249         * ptfork.c (__fork): Call new handlers in mutex.c.
2250         * internals.h: Declarations of new mutex.c functions added.
2251         Declaration of removed function deleted.
2252         * linuxthreads.texi: Updated documentation about pthread_once
2253         to clarify what happens under cancellation and forking.
2255 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
2257         * internals.h: New thread manager request type, REQ_KICK.
2258         * join.c (pthread_exit): main thread now calls exit() instead
2259         of _exit() in order to proper process cleanup.
2260         * manager.c (__pthread_manager): Do not terminate manager
2261         after unblocking main thread; wait for main thread's
2262         REQ_PROCESS_EXIT request instead.
2263         Also, added REQ_KICK case to handle new request; this just does
2264         nothing.
2265         * manager.c (pthread_exited): Do not terminate manager after
2266         unblocking main thread.
2267         * manager.c (__pthread_manager_sighandler): If the main thread
2268         is waiting for all other threads to die, send a REQ_KICK into
2269         the thread manager request pipe to get it to clean out the threads
2270         and unblock the main thread as soon as possible. This fixes
2271         the 2000 millisecond hang on shutdown bug.
2272         * Examples/ex7.c: New file, tests shutdown behavior when all threads
2273         including the main one call pthread_exit(), or implicitly do so.
2274         * Makefile (tests): Add ex7.
2276 2000-05-05  Andreas Jaeger  <aj@suse.de>
2278         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2279         (pthread_getcpuclockid): Correct test for ourselves.
2281 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
2283         * internals.h (struct _pthread_descr_struct): Reorganization.
2284         Allocate room for 16 pointers at head of the structure for future
2285         thread-local data handling.  Move p_self member in this area.
2286         * manager.c (pthread_handle_create): Adjust use of p_self.
2287         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
2288         * pthread.c (__pthread_initial_thread): Adjust initialization.
2289         (__pthread_manager_thread): Likewise.
2291 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
2293         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
2294         for eventmask larger than 1 word.
2296 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
2298         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
2299         * pthread.c (__pthread_initialize_minimal): New function.  Perform
2300         minimal initialization.
2301         (pthread_initialize): Remove this code here.
2302         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
2303         are working around the problem in glibc.
2305 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
2307         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
2308         now.  First gcc must be fixed (more concrete: libgcc).
2310 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
2312         * pthread.c: Remove special treatement for interrupt handlers on x86.
2313         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
2314         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
2315         necessary.
2316         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
2318 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
2320         * join.c (pthread_exit): Set p_terminated after reporting the
2321         termination event instead of before.
2323 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
2325         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
2326         if __USE_UNIX98.
2328 2000-04-18  Andreas Jaeger  <aj@suse.de>
2330         * Versions: Use ld instead of ld.so.
2332 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2334         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
2335         Remove the typedef keyword.
2337 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
2339         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
2340         not stbar.
2341         (READ_MEMORY_BARRIER): Define.
2342         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
2343         MEMORY_BARRIER.
2344         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
2345         headers.
2347 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
2349         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2350         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
2351         use thread_handle().
2353 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
2355         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
2356         if fast mutex is used.  Don't initialize `already_canceled' twice.
2357         Correctly test for return value of timedsuspend.
2359         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
2360         therefore don't need the _rt versions of the signal handlers.
2362 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2364         * pthread.c (pthread_yield): New function.
2365         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
2366         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
2367         * internals.h: Declare __pthread_yield.
2369         * pthread.c (pthread_initialize): Avoid a bit more code if
2370         realtime signals are known to exist.
2372         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
2373         to dynamically detect RT signals and avoid generating compatibility
2374         functions with old kernel.
2375         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
2376         __pthread_restart_new directly.
2377         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
2378         __pthread_wait_for_restart_signal directly.
2379         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
2380         __pthread_timedsuspend_new directly.
2382 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
2384         * condvar.c: Remove all the special code to handle cond_timedwait.
2385         Use timedsuspend instead.
2386         * internals.h: Declare __pthread_timedsuspend_old,
2387         __pthread_timedsuspend_new, and __pthread_timedsuspend.
2388         Remove declaration of __pthread_init_condvar.
2389         * pthread.c: Define __pthread_timedsuspend variable.
2390         (__pthread_timedsuspend_old): New function.  Timed suspension
2391         implementation for old Linux kernels.
2392         (__pthread_timedsuspend_new): New function.  Timed suspension
2393         implementation for new Linux kernels.
2394         * restart.h (timedsuspend): New function.  Call appropriate
2395         suspension function through __pthread_timedsuspend.
2396         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
2397         the code.
2398         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2400         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
2401         undefined.
2402         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
2403         where possible.
2404         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
2405         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2407         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
2408         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2410 2000-04-14  Andreas Jaeger  <aj@suse.de>
2412         * weaks.c: Fix typo.
2414         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
2415         2.2 for linuxthreads.
2417 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
2419         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
2420         (pthread_getcpuclockid): Fix typo.
2422 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
2424         * Makefile (libpthread-routines): Add getcpuclockid.
2425         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
2426         * sysdeps/pthread/getcpuclockid.c: New file.
2427         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
2428         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
2430         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
2431         Defined.
2432         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2434         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
2435         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2436         and pthread_spin_unlock.
2437         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
2438         into pthread_spinlock_t.  Change all uses.
2439         * spinlock.c: Implement pthread_spin_lock.
2440         Rename __pthread_unlock to __pthread_spin_unlock and define weak
2441         alias for real name.
2442         Define pthread_spin_trylock, pthread_spin_init, and
2443         pthread_spin_destroy.
2444         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2445         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
2446         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2447         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
2448         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
2449         and pthread_spin_unlock.
2450         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
2451         Change all uses of _pthread_fastlock to pthread_spinlock_t.
2452         * condvar.c: Likewise.
2453         * internals.h: Likewise.
2454         * join.c: Likewise.
2455         * manager.c: Likewise.
2456         * mutex.c: Likewise.
2457         * pthread.c: Likewise.
2458         * rwlock.c: Likewise.
2459         * semaphore.c: Likewise.
2460         * signals.c: Likewise.
2462         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
2463         macros.
2464         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
2466 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2468         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
2469         _POSIX_SHARED_MEMORY_OBJECTS.
2471 2000-04-11  Andreas Jaeger  <aj@suse.de>
2473         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
2474         (__compare_and_swap): Mark as modifying memory.
2476 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
2478         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
2479         __volatile__.
2480         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
2481         Don't have the 'asm' __volatile__.
2483 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
2485         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
2486         * spinlock.c (__pthread_lock): Add memory barriers.
2487         (__pthread_unlock): Likewise.
2488         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
2489         instruction.
2490         (RELEASE): Not needed anymore.
2491         (__compare_and_swap): Mark asm as modifying memory.
2492         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
2493         of MEMORY_BARRIER.
2494         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
2495         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
2496         (MEMORY_BARRIER): Define using stbar.
2497         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
2498         stbar.
2499         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
2500         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
2501         Mike Burrows <m3b@pa.dec.com>.
2503 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
2505         * signals.c (sigaction): Fix return value for the case SIG is one
2506         of the signals the implementation uses.
2507         Patch by Xavier.Leroy@inria.fr.
2509 2000-04-01  Andreas Jaeger  <aj@suse.de>
2511         * attr.c: Use shlib-compat macros.
2512         * oldsemaphore.c: Likewise.
2513         * pthread.c: Likewise.
2514         * weaks.c: Likewise.
2516 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
2518         * semaphore.c (sem_timedwait): New function.
2519         Patch by Carl Mailloux <carlm@oricom.ca>.
2520         * semaphore.h: Declare sem_timedwait.
2521         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
2523 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
2525         * sysdeps/pthread/Makefile: File removed.
2527 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
2529         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
2530         * internals.h (__pthread_reset_pthread_once): Add prototype.
2531         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
2533         * manager.c (pthread_handle_create): Store ID of new thread before
2534         clone call.
2536 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
2538         * attr.c: Use new macros from shlib-compat.h to define versions.
2539         * oldsemaphore.c: Likewise.
2540         * semaphore.c: Likewise.
2541         * weaks.c: Likewise.
2543         * pthread.c: Update for new SHLIB_COMPAT definition.
2545         * manager.c (__pthread_manager): Unmask debug signal.
2547         * pthread.c (pthread_initialize): Test for address of __dso_handle
2548         being NULL, not value.  Use __on_exit, not on_exit.
2549         Patch by Andreas Jaeger <aj@suse.de>.
2551         * pthread.c: Use new macros from shlib-compat.h to define versions.
2553 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
2555         * pthread.c (pthread_initialize): Instead of on_exit use
2556         __cxa_atexit if __dso_label is available to allow unloading the
2557         libpthread shared library.
2559 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
2561         * condvar.c: Make tests for ownership of mutex less strict.
2563 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
2565         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
2566         current thread and return error if not.
2567         (pthread_cond_timedwait_relative_old): Likewise.
2568         (pthread_cond_timedwait_relative_new): Likewise.
2570         * mutex.c (__pthread_once): Handle cancelled init function correctly.
2571         (pthread_once_cancelhandler): New function.
2572         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2574 2000-03-14  Andreas Jaeger  <aj@suse.de>
2576         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
2577         REG_GS.
2578         (pthread_handle_sigrestart_rt): Likewise.
2579         * signals.c (pthread_sighandler_rt): Likewise.
2581 2000-03-02  Andreas Jaeger  <aj@suse.de>
2583         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
2584         Reported by Sean Chen <sean.chen@turbolinux.com>.
2586 2000-02-28  Andreas Jaeger  <aj@suse.de>
2588         * rwlock.c: Fix typo.
2590 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
2592         * rwlock.c: Define __* variants of the functions and make old names
2593         aliases.
2594         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
2595         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
2597 2000-02-25  Andreas Jaeger  <aj@suse.de>
2599         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2600         pwrite64, lseek64, open64, and __open64 with version 2.2.
2602 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
2604         * semaphore.h (SEM_FAILED): Use 0 not NULL.
2606 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
2608         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
2609         nanosleep does not work either.  Get absolute time inside the
2610         loop.
2611         (pthread_cond_timedwait_relative_new): Likewise.
2612         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
2614 2000-02-13  Andreas Jaeger  <aj@suse.de>
2616         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
2617         (pthread_cond_timedwait_relative_old): Likewise.
2619 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
2621         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
2622         but keep the code around.  A bug in the kernel prevent us from
2623         using the code.
2624         (pthread_cond_timedwait_relative_new): Likewise.
2625         (PR libc/1597 and libc/1598).
2627 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
2629         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
2630         loop around nanosleep calls instead of around most of the function
2631         (pthread_cond_timedwait_relative_new): Likewise.
2632         body.  Got rid of backwards goto and one local.
2634 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
2636         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
2637         before every nanosleep call to account for time spent in the rest
2638         of the function.
2639         (pthread_cond_timedwait_relative_new): Likewise.
2640         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
2642 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
2644         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
2645         from nanosleep call so that in case we restart we only wait for the
2646         remaining time.
2647         (pthread_cond_timedwait_relative_new): Likewise.
2648         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
2650 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
2652         * manager.c (pthread_allocate_stack): Compute guard page address
2653         correctly.  Patch by HJ Lu.
2655         * sysdeps/pthread/pthread.h: Define
2656         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
2658 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
2660         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
2661         preference handling.
2662         (pthread_rwlockattr_setkind_np): Allow
2663         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
2664         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2666 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
2668         * internals.h (pthread_readlock_info): New structure.
2669         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
2670         p_untracked_readlock_count.
2671         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2672         Add initializers for new fields.
2673         * manager.c (pthread_free): Free read/write lock lists.
2674         * queue.h (queue_is_empty): New function.
2675         * rwlock.c: Implement requirements about when readers should get
2676         locks assigned.
2677         * sysdeps/pthread/pthread.h
2678         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
2679         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
2680         Define this name as well.
2681         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
2683 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
2685         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
2686         Adjust initializers for struct _pthread_descr_struct change.
2687         * internals.h (struct _pthread_descr_struct): Move new elements to
2688         the end.
2690 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
2692         Redesigned how cancellation unblocks a thread from internal
2693         cancellation points (sem_wait, pthread_join,
2694         pthread_cond_{wait,timedwait}).
2695         Cancellation won't eat a signal in any of these functions
2696         (*required* by POSIX and Single Unix Spec!).
2697         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
2698         simultaneous condition variable signal (not required by POSIX
2699         or Single Unix Spec, but nice).
2700         * spinlock.c: __pthread_lock queues back any received restarts
2701         that don't belong to it instead of assuming ownership of lock
2702         upon any restart; fastlock can no longer be acquired by two threads
2703         simultaneously.
2704         * restart.h: Restarts queue even on kernels that don't have
2705         queued real time signals (2.0, early 2.1), thanks to atomic counter,
2706         avoiding a rare race condition in pthread_cond_timedwait.
2708 1999-12-31  Andreas Jaeger  <aj@suse.de>
2710         * internals.h: Remove duplicate prototype declarations.
2712         * weaks.c: Remove __THROW from prototypes since the file is not
2713         compiled by a C++ compiler.
2714         * internals.h: Likewise.
2716 1999-12-30  Andreas Jaeger  <aj@suse.de>
2718         * sysdeps/pthread/pthread.h: Move internal functions to...
2719         * sysdeps/pthread/bits/libc-lock.h: ...here.
2721 1999-12-29  Andreas Jaeger  <aj@suse.de>
2723         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
2725 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
2727         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
2728         beginning.
2730         * manager.c (__pthread_start): Add one more cast to prevent
2731         warning on 64bit machines.
2733 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
2735         * manager.c (pthread_handle_create): Set p_pid of new thread
2736         before calling the callback function to report a new thread.
2738 1999-12-20  Andreas Jaeger  <aj@suse.de>
2740         * pthread.c (pthread_initialize): Move getrlimit call after
2741         setting of errno.
2743 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
2745         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2746         pwrite64, lseek64, open64, and __open64.
2747         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2748         pwrite64, lseek64, open64, and __open64.
2750         * manager.c (pthread_allocate_stack): Correct computation of
2751         new_thread_bottom.  Correct handling of stack size and when the
2752         rlimit method to guard for stack growth is used.
2753         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2754         minus one pagesize (not two).
2756 1999-12-03  Andreas Jaeger  <aj@suse.de>
2758         * Versions: Add __res_state with version GLIBC_2.2.
2760         * errno.c (__res_state): New function to return thread specific
2761         resolver state.
2763         * pthread.c (pthread_initialize): Initialize p_resp.
2764         (__pthread_reset_main_thread): Also set p_resp.
2766         * manager.c (pthread_handle_create): Initialize p_resp.
2768         * internals.h: Add thread specific resolver state.
2769         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2771 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
2773         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2774         beginning.
2775         * sysdeps/i386/i686/pt-machine.h: Likewise.
2776         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2778 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
2780         * manager.c (pthread_start_thread_event): Initialize p_pid already
2781         here.
2783 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
2785         * internals.h: Add prototype for __pthread_manager_event.
2786         * manager.c (__pthread_manager_event): New function.
2787         (pthread_start_thread_event): Correct computation of self.
2788         Use INIT_THREAD_SELF.
2789         * pthread.c (__pthread_manager_thread): Initialize p_lock.
2790         (__pthread_initialize_manager): Respect event flags also for creation
2791         of the manager thread.
2793 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
2795         * pthread.c (__pthread_initialize_manager): Initialize
2796         __pthread_manager_thread.p_tid.
2798 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
2800         * internals.h: Declare __pthread_last_event.
2801         * manager.c: Define __pthread_last_event.
2802         (pthread_handle_create): Set __pthread_last_event.
2803         (pthread_exited): Likewise.
2804         * join.c (pthread_exit): Likewise.
2806         * Makefile (libpthread-routines): Add events.
2807         * events.c: New file.
2808         * internals.h: Protect against multiple inclusion.
2809         Include thread_dbP.h header.
2810         (struct _pthread_descr_struct): Add new fields p_report_events and
2811         p_eventbuf.
2812         Declare event reporting functions.
2813         * join.c (pthread_exit): Signal event if this is wanted.
2814         * manager.c (__pthread_threads_events): New variable.
2815         (pthread_handle_create): Take new parameters with event information.
2816         Signal TD_CREATE event if wanted.
2817         (__pthread_manager): Adjust pthread_handle_create call.
2818         (pthread_start_thread_event): New function.  Block until manager is
2819         finished and then call pthread_start_thread.
2820         (pthread_exited): Signal TD_REAP event if wanted.
2822 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
2824         * restart.h (suspend_with_cancellation): Rewrite as a macro.
2826         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
2828 1999-10-25  Andreas Jaeger  <aj@suse.de>
2830         * internals.h: Remove K&R compatibility.
2831         * no-tsd.c: Likewise.
2832         * semaphore.h: Likewise.
2833         * signals.c: Likewise.
2834         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
2835         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
2836         * weaks.c: Likewise.
2838 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
2840         * pthread.c: For i386, wrap pthread_handle_sigrestart and
2841         pthread_handle_sigcancel with functions that restore %gs from the
2842         signal context.  For each signal handling function, two wrappers
2843         are required, one for a non-RT signal and one for a RT signal.
2844         * signal.c: For i386, add code to restore %gs from the signal
2845         context in pthread_sighandler and pthread_sighandler_rt.
2847 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
2849         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
2851 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
2853         * pthread.c (__pthread_initial_thread): Pass argument to
2854         PTHREAD_START_ARGS_INITIALIZER.
2855         (__pthread_manager_thread): Likewise.
2857         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
2858         initialize function.
2860         * manager.c (pthread_handle_create): Remove p_startfct initialization.
2862         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
2864 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
2866         * internals.h: Correct return types for __libc_read and __libc_write.
2868 1999-10-09  Andreas Jaeger  <aj@suse.de>
2870         * internals.h: Add __new_sem_post to get prototype in
2871         manager.c; include semaphore.h for needed types.
2873 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
2875         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
2876         directly instead of calling sem_post which should not be necessary
2877         but is faster and might help in some case to work around problems.
2878         Patch by khendricks@ivey.uwo.ca [libc/1382].
2880 1999-10-08  Andreas Schwab  <schwab@suse.de>
2882         * sysdeps/pthread/Subdirs: New file.
2883         * Implies: Removed.
2885 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
2887         * Implies: New file.
2888         * internals.h (struct _pthread_descr_struct): Add p_startfct.
2889         * manager.c (pthread_handle_create): Initialize p_startfct.
2890         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
2892 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
2894         * manager.c (__linuxthreads_pthread_threads_max): New variable.
2895         * specific.c (__linuxthreads_pthread_keys_max): New variable.
2896         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
2898         * condvar.c (pthread_cond_timedwait_relative): Never return with
2899         EINTR.  Patch by Andreas Schwab.
2901 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
2903         * signals.c (sigaction): Correct last patch.  Don't select
2904         pthread_sighandler_rt based on the signal number but instead of
2905         the SA_SIGINFO flag.
2907 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
2909         * specific.c: Move definitions of struct pthread_key_struct and
2910         destr_function to ...
2911         * internals.h: ...here.
2913 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
2915         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
2916         this instead of pthread_handle_sigrestart if the signal is an RT
2917         signal.
2919         * signals.c: Handle passing through of sighandler arguments also
2920         for real-time signals.
2922 1999-09-03  Andreas Schwab  <schwab@suse.de>
2924         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
2925         fork as weak alias.
2926         (__vfork): New function, alias vfork.
2927         * Versions: Export __fork, vfork, and __vfork in libpthread.
2929 1999-08-23  Andreas Schwab  <schwab@suse.de>
2931         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
2932         call to signal handler.
2934 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
2936         * pthread.c (__pthread_reset_main_thread): Undo last change.
2937         (__pthread_kill_other_threads_np): Reset signal handlers for the
2938         signals we used in the thread implementation here.
2940 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
2942         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
2943         for the signals we used in the thread implementation [PR libc/1234].
2945         * Versions: Export __pthread_kill_other_threads_np from libpthread
2946         for GLIBC_2.1.2.
2948         * signals.c: Pass sigcontext through wrapper to the user function.
2950 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
2952         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
2953         __libc_internal_tsd_set.
2955 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2957         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
2958         needed anymore.
2960 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2962         * internals.h: Align _pthread_descr_struct to 32 bytes.
2963         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
2964         libc/1206.
2966 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
2968         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
2969         swap function.
2971 1999-07-09  Cristian Gafton  <gafton@redhat.com>
2973         * Makefile (libpthread-routines): Add oldsemaphore routine.
2974         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
2975         sem_trywait, and sem_wait to GLIBC_2.1.
2976         * oldsemaphore.c: New file.
2977         * semaphore.c: Add default_symbol_versions for the changed functions.
2978         (__new_sem_init): Rename from sem_init.
2979         (__new_sem_post): Rename from sem_post.
2980         (__new_sem_wait): Rename from sem_wait.
2981         (__new_sem_trywait): Rename from sem_trywait.
2982         (__new_sem_getvalue): Rename from sem_getvalue.
2983         (__new_sem_destroy): Rename from sem_destroy.
2985 1999-06-23  Robey Pointer  <robey@netscape.com>
2987         * internals.h: Added p_nextlock entry to separate queueing for a
2988         lock from queueing for a CV (sometimes a thread queues on a lock
2989         to serialize removing itself from a CV queue).
2990         * pthread.c: Added p_nextlock to initializers.
2991         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
2993 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
2995         * manager.c (pthread_handle_create): Free mmap region after stack
2996         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
2998 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3000         * man/pthread_cond_init.man: Correct example.
3001         Reported by Tomas Berndtsson <tomas@nocrew.org>.
3003         * linuxthreads.texi (Condition Variables): Likewise.
3005 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
3007         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
3008         casx not cas, also successful casx returns the old value in rd
3009         and not the new value.
3011 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
3013         * manager.c: If pthread_create() is given a NULL attribute
3014         and the thread manager runs with a realtime policy, set the
3015         scheduling policy of the newly created thread back to SCHED_OTHER.
3016         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
3017         initialize the schedpolicy field of new_thread->p_start_args
3018         to that of the calling thread.
3020 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
3022         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
3023         instruction does not allow memory element to use offset.
3025 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
3027         * manager.c (pthread_allocate_stack): Optimize initialization of new
3028         thread descriptor.
3030         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
3031         Don't use initializer since it is all zeroes.
3032         (__libc_once_define): Likewise.
3034 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3036         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
3037         doesn't exist anymore.
3038         * sysdeps/i386/Implies: Likewise.
3039         * sysdeps/m68k/Implies: Likewise.
3040         * sysdeps/mips/Implies: Likewise.
3041         * sysdeps/powerpc/Implies: Likewise.
3042         * sysdeps/sparc/sparc32/Implies: Likewise.
3043         * sysdeps/sparc/sparc64/Implies: Likewise.
3045 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
3047         * sysdeps/alpha/bits/semaphore.h: Removed.
3048         * sysdeps/powerpc/bits/semaphore.h: Removed.
3049         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
3050         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
3051         * Makefile (headers): Remove bits/semaphore.h.
3053         * semaphore.h: Define _pthread_descr if necessary.
3054         Don't include limits.h.  Define SEM_VALUE_MAX directly.
3055         Define SEM_FAILED.
3056         (sem_t): Protect element names with leading __.
3057         Add declarations for sem_close, sem_open, and sem_unlink.
3058         * semaphore.c: Adjust all functions for new element names.
3059         Define sem_close, sem_open, and sem_unlink.
3060         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
3061         GLIBC_2.1.1.
3062         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
3063         necessary.
3065 1999-03-16  H.J. Lu  <hjl@gnu.org>
3067         * specific.c (pthread_key_delete): Check th->p_terminated to see
3068         if the thread is running.
3070         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
3071         Added to GLIBC_2.0 for libc.so.
3073 1999-02-12  H.J. Lu  <hjl@gnu.org>
3075         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
3076         __libc_allocate_rtsig): Added to GLIBC_2.1.
3078         * internals.h (DEFAULT_SIG_RESTART): Removed.
3079         (DEFAULT_SIG_CANCEL): Removed.
3081         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
3082         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
3083         (__pthread_sig_restart, __pthread_sig_cancel,
3084         __pthread_sig_debug): Initialized.
3085         (pthread_initialize): Call init_rtsigs () to initialize
3086         real-time signals.
3088 1999-02-03  H.J. Lu  <hjl@gnu.org>
3090         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
3091         Don't restart the thread which sent REQ_DEBUG.
3092         (pthread_start_thread): Check if __pthread_sig_debug > 0
3093         before debugging.
3095         * pthread.c (__pthread_initialize_manager): Suspend ourself
3096         after sending __pthread_sig_debug to gdb instead of
3097         __pthread_sig_cancel.
3099 1999-01-24  H.J. Lu  <hjl@gnu.org>
3101         * manager.c (__pthread_manager): Delete __pthread_sig_debug
3102         from mask if __pthread_sig_debug > 0.
3103         (pthread_handle_create): Increment __pthread_handles_num.
3105         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
3106         * pthread.c (__pthread_initialize_manager): Likewise.
3108         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
3109         instead of __libc_allocate_rtsig (2).
3110         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
3111         instead of __pthread_sig_cancel.
3112         (pthread_handle_sigdebug): Fix comments.
3114 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
3116         * manager.c (pthread_allocate_stack): Set
3117         __pthread_nonstandard_stacks if user-specified stack is used.
3119 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
3121         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
3122         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
3124 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
3126         * pthread.c: Use a third signal __pthread_sig_debug distinct
3127         from __pthread_sig_cancel to notify gdb when a thread is
3128         created
3129         * manager.c: Likewise.
3130         * internals.h: Likewise.
3131         * signals.c: The implementation of sigwait(s) assumed that
3132         all signals in s have signal handlers already attached.
3133         This is not required by the standard, so make it work
3134         also if some of the signals have no handlers.
3136 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3138         * linuxthreads.texi: Remove pointers from first @node.  Move old
3139         @node spec inside comment.
3141 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
3143         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
3144         _IO_lock_unlock.
3146 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
3148         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
3149         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
3151 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
3153         * manager.c: Threads now send __pthread_sig_cancel on termination.
3154         Change clone call and signal masks.
3155         * thread.c (pthread_handle_sigrestart): Remove special code for
3156         manager.
3157         (pthread_handle_sigcancel): In manager thread call
3158         __pthread_manager_sighandler.
3159         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
3160         * sysdeps/i386/i686/pt-machine.h: Likewise.
3161         Patches by Xavier Leroy.
3163 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
3165         * spinlock.c (__pthread_unlock): Don't crash if called for an
3166         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
3168         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
3169         overall runtime.
3171 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
3173         * Examples/ex3.c: Wait until all threads are started before
3174         searching for the number to avoid race condition on very fast
3175         systems.
3177 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3179         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
3180         declaration since it's not needed.
3182         * sysdeps/pthread/pthread.h: Move internal functions to ...
3183         * internals.h: ...here.
3185 1998-12-02  H.J. Lu  <hjl@gnu.org>
3187         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
3188         SIGRTMIN is defined.
3189         (__pthread_sig_cancel): Likewise.
3191 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3193         * wrapsyscall.c: Include <sys/mman.h> for msync,
3194         <stdlib.h> for system and <termios.h> for tcdrain prototype.
3195         Correct msync declaration.
3197 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
3199         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
3200         __libc_tsd_set): New macros for new interface.
3201         * no-tsd.c: New file, provide uninitialized defns of
3202         __libc_internal_tsd_get and __libc_internal_tsd_set.
3203         * Makefile (routines): Add no-tsd.
3205 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
3207         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
3208         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3209         __libc_internal_tsd_set): Move decls to ...
3210         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
3211         declarations.
3213         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
3214         __libc_internal_tsd_set): Make these pointers to functions, not
3215         functions; remove #pragma weak decls for them.
3216         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
3217         Define static functions and initialized pointers to them.
3219 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
3221         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
3222         (CFLAGS-specific.c): Likewise.
3223         (CFLAGS-pthread.c): Likewise.
3224         (CFLAGS-ptfork.c): Likewise.
3225         (CFLAGS-cancel.c): Likewise.
3226         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
3227         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
3229         * mutex.c (pthread_mutex_init): Define as strong symbol.
3230         (pthread_mutex_destroy): Likewise.
3231         (pthread_mutex_trylock): Likewise.
3232         (pthread_mutex_lock): Likewise.
3233         (pthread_mutex_unlock): Likewise.
3234         (pthread_mutexattr_init): Likewise.
3235         (pthread_mutexattr_destroy): Likewise.
3236         (pthread_once): Likewise.
3237         * ptfork.c (pthread_atfork): Likewise.
3238         * specific.c (pthread_key_create): Likewise.
3239         (pthread_setspecific): Likewise.
3240         (pthread_getspecific): Likewise.
3242 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3244         * linuxthreads.texi: Fix punctuation after xref.
3246 1998-11-10  H.J. Lu  <hjl@gnu.org>
3248         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
3249         if it is defined in <linux/limits.h>.
3251 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
3253         * spinlock.h (__pthread_trylock): Define inline.
3254         (__pthread_lock): Add extra parameter to declaration.  Declare
3255         using internal_function.
3256         (__pthread_unlock): Declare using internal_function.
3257         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
3258         of local variable self.  Avoid recomputing self.  Define using
3259         internal_function.
3260         (__pthread_trylock): Remove.
3261         (__pthread_unlock): Define using internal_function.
3262         * cancel.c: Adjust for __pthread_lock interface change.  Use already
3263         computed self value is possible.
3264         * condvar.c: Likewise.
3265         * join.c: Likewise.
3266         * manager.c: Likewise.
3267         * mutex.c: Likewise.
3268         * pthread.c: Likewise.
3269         * rwlock.c: Likewise.
3270         * semaphore.c: Likewise.
3271         * signals.c: Likewise.
3273 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
3275         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
3276         __ to field names of the struct.
3277         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
3278         Likewise.
3279         (pthread_attr_t): Likewise.
3280         (pthread_cond_t): Likewise.
3281         (pthread_condattr_t): Likewise.
3282         (pthread_mutex_t): Likewise.
3283         (pthread_mutexattr_t): Likewise.
3284         (pthread_rwlock_t): Likewise.
3285         (pthread_rwlockattr_t): Likewise.
3286         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
3287         * cancel.c: Likewise.
3288         * condvar.c: Likewise.
3289         * manager.c: Likewise.
3290         * mutex.c: Likewise.
3291         * pthread.c: Likewise.
3292         * ptlongjmp.c: Likewise.
3293         * rwlock.c: Likewise.
3294         * spinlock.c: Likewise.
3296 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
3298         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
3299         also with PT_EI.
3301         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
3302         definitions.
3304         * Makefile (libpthread-routines): Add pt-machine.
3305         * pt-machine.c: New file.
3306         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
3307         yet defined.  Use PT_EI in extern inline definitions.
3308         * sysdeps/arm/pt-machine.h: Likewise.
3309         * sysdeps/i386/pt-machine.h: Likewise.
3310         * sysdeps/i386/i686/pt-machine.h: Likewise.
3311         * sysdeps/m68k/pt-machine.h: Likewise.
3312         * sysdeps/mips/pt-machine.h: Likewise.
3313         * sysdeps/powerpc/pt-machine.h: Likewise.
3314         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
3315         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3317 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3319         * semaphore.h: Include <sys/types.h> so that _pthread_descr
3320         is declared.
3322 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
3324         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
3325         argument.
3326         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
3328 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3330         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
3331         guard.
3333 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3335         * signals.c (sigaction): Check that sig is less than NSIG to avoid
3336         array index overflow.
3338 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
3340         * sysdeps/pthread/semaphore.h: New file.
3342 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
3344         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
3345         _LIBC_TSD_KEY_DL_ERROR.
3347 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
3349         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
3350         * sysdeps/i386/pt-machine.h: Likewise.
3351         Suggested by Roland McGrath.
3353 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
3355         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
3356         access thread data with non-constant offsets.
3357         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
3358         necessary.
3360         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
3361         THREAD_SETMEM_NC definitions.
3363         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
3364         THREAD_SETMEM_NC.
3365         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3367 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
3369         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
3370         not already defined.
3371         (struct _pthread_descr_struct): Add p_self and p_nr field.
3372         * manager.c (__pthread_handles): Define second element to point
3373         to manager thread.
3374         (__pthread_handles_num): Initialize to 2.
3375         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
3376         (pthread_start_thread): Likewise.
3377         (pthread_handle_create): Start search for free slot at entry 2.
3378         Initialize new fields p_self and p_nr.
3379         Call __clone with CLONE_PTRACE if available.
3380         (pthread_free): Call FREE_THREAD_SELF if available.
3381         * pthread.c (__pthread_initial_thread): Initialize new fields.
3382         (__pthread_manager_thread): Likewise.
3383         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
3385         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
3386         elements of the thread descriptor.
3387         * condvar.c: Likewise.
3388         * errno.c: Likewise.
3389         * join.c: Likewise.
3390         * manager.c: Likewise.
3391         * pthread.c: Likewise.
3392         * ptlongjmp.c: Likewise.
3393         * semaphore.c: Likewise.
3394         * signals.c: Likewise.
3395         * specific.c: Likewise.
3396         * spinlock.c: Likewise.
3398         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
3400         * sysdeps/i386/useldt.h: New file.
3401         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
3403         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
3404         THREAD_SETMEM using __thread_self.
3405         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3407 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
3409         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
3410         turned out that we didn't need to queue after all.
3412 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
3414         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
3415         and wastes space; correct types.
3417 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
3419         * signals.c (sigaction): Handle NULL argument.
3421 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
3423         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
3424         of sigset_t.
3426 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3428         * Makefile (linuxthreads-version): Extract correct number from
3429         Banner.
3431 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
3433         * Banner: Bump version number to 0.8
3434         * FAQ.html: Many updates, in particular w.r.t. debugging.
3435         * manager.c: Support for non-default stacksize for
3436         LinuxThreads-allocated stacks;
3437         don't use guard pages for stacks with default size, rely on
3438         rlimit(RLIMIT_STACK) instead (it's cheaper).
3439         * attr.c: Likewise.
3440         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
3441         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
3442         * condvar.c: Likewise.
3443         * internals.h: Likewise.
3444         * restart.h: Likewise.
3445         * signals.c: Likewise.
3446         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
3448 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3450         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
3451         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
3452         * Versions: Put __pthread_mutexattr_settype under version
3453         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
3454         __pthread_mutexattr_gettype.
3456 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3458         * sysdeps/pthread/bits/libc-lock.h: Make
3459         __pthread_mutexattr_settype weak.  Don't make
3460         __pthread_mutexattr_setkind_np weak.
3462 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
3464         * manager.c (pthread_handle_create): Check whether sched_setscheduler
3465         call can succeed here.
3467         * mutex.c: Define __pthread_mutexattr_settype and make
3468         __pthread_mutexattr_setkind_np an alias.
3469         Likewise for __pthread_mutexattr_gettype.
3471 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3473         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
3474         is root.
3476 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
3478         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
3480 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3482         * Examples/ex6.c: Include <unistd.h> for usleep.
3484 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3486         * Examples/ex4.c (main): Use exit, not pthread_exit.
3488 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
3490         * Versions: Add __pthread_mutexattr_gettype and
3491         __pthread_mutexattr_settype.
3492         * lockfile.c: Use __pthread_mutexattr_settype instead of
3493         __pthread_mutexattr_setkind_np.
3494         * mutex.c: Define __pthread_mutexattr_gettype and
3495         __pthread_mutexattr_settype.
3496         * weak.c: Likewise.
3497         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
3498         __pthread_mutexattr_settype.
3499         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
3500         Use __pthread_mutexattr_settype.
3502 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
3504         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
3505         * mutex.c: Define weak alias pthread_mutexattr_gettype and
3506         pthread_mutexattr_settype.
3507         * sysdeps/pthread/pthread.h: Declare these functions.
3508         Move pthread_sigmask and pthread_kill declaration in separate header.
3509         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
3511 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
3513         * Makefile: Add rules to compile and run tests.
3514         * Examples/ex1.c: Little changes to fix warnings.
3515         * Examples/ex2.c: Likewise.
3516         * Examples/ex3.c: Likewise.
3517         * Examples/ex4.c: Likewise.
3518         * Examples/ex5.c: Likewise.
3519         * Examples/ex6.c: New file.
3521 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
3523         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
3525 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3527         * attr.c: Include <string.h>.
3529 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
3531         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
3532         * internals.h: Include limits.h.
3533         * manager.c: Use memcpy to copy sched_param.
3534         * ptfork.c: Include errno.h.
3535         * pthread.c: Likewise.
3536         * semaphore.c: Likewise.
3537         * specific.c: Likewise.
3538         * spinlock.h: Likewise.
3539         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
3540         type definition to ...
3541         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
3543 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
3545         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
3547         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
3548         as macros as demanded in POSIX.1, Annex C.
3550 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
3552         * internals.h (struct pthread_request): For free use pthread_t
3553         instead of pthread_descr.
3554         * join.c (pthread_join): Pass thread_id, not th to manager.
3555         (pthread_detach): Likewise.
3556         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
3557         (pthread_exited): Remove detached queue code.
3558         (pthread_handle_free): Expect thread ID parameter and use it to
3559         validate the thread decsriptor.  Don't use detached queue.
3560         Patches by Xavier Leroy.
3562 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3564         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
3565         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
3566         __pthread_atfork, __pthread_key_create, __pthread_once.
3567         * internals.h: Doc fix.
3568         * pthread.c (__pthread_initialize): Define again.
3570 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
3572         * manager.c (pthread_exited): If thread is not detached put it on
3573         special list.
3574         (pthread_handle_free): If thread is not on list with living threads
3575         search on list with detached threads.
3577         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
3578         for new definition of pthread_rwlock_t.
3580         * spinlock.c: Correct test whether to compile
3581         __pthread_compare_and_swap or not.
3583 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
3585         * attr.c: Finish user stack support.  Change locking code to be safe
3586         in situations with different priorities.
3587         * cancel.c: Likewise.
3588         * condvar.c: Likewise.
3589         * internals.h: Likewise.
3590         * join.c: Likewise.
3591         * manager.c: Likewise.
3592         * mutex.c: Likewise.
3593         * pthread.c: Likewise.
3594         * ptlongjmp.c: Likewise.
3595         * queue.h: Likewise.
3596         * rwlock.c: Likewise.
3597         * semaphore.c: Likewise.
3598         * semaphore.h: Likewise.
3599         * signals.c: Likewise.
3600         * spinlock.c: Likewise.
3601         * spinlock.h: Likewise.
3602         * sysdeps/pthread/pthread.h: Likewise.
3603         Patches by Xavier Leroy.
3605         * sysdeps/i386/i686/pt-machine.h: New file.
3607 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
3609         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
3610         [sg]et_stackaddr prototypes always available.
3612         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3613         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
3615 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
3617         * manager.c (pthread_free): Undo patch from 980430.
3618         Reported by David Wragg <dpw@doc.ic.ac.uk>.
3620 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
3622         * manager.c: Define __pthread_manager_adjust_prio and use it to
3623         increase priority when needed.
3624         * internals.h: Add prototype for __pthread_manager_adjust_prio.
3625         * mutex.c: Optimize mutexes to wake up only one thread.
3626         * pthread.c: Move PID of manager for global variable in structure
3627         element.
3628         Patches by Xavier Leroy.
3630 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
3632         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
3634 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
3636         * attr.c: Correct typo.
3638 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
3640         * manager.c (pthread_free): Unmap guard before the stack.
3641         Patch by Matthias Urlichs.
3643 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
3645         * manager.c (pthread_free): Detect already free child.
3646         Patch by Xavier Leroy, reported by Matthias Urlichs.
3648 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3650         * Makefile (linuxthreads-version): Renamed back from
3651         libpthread-version.
3653 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
3655         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
3656         __libc_longjmp.
3658 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
3660         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
3661         * internals.h: Add definitions for new spinlock implementation.
3662         * ptlongjmp.c: New file.
3663         * spinlock.c: New file.
3664         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
3665         new function __pthread_acquire to prevent deadlocks with thread
3666         with different priorities.
3667         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
3669 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3671         * manager.c (__pthread_manager): Reduce first argument to select
3672         to include just the needed file descriptor.
3674 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
3676         * manager.c: Fix last patch which caused core dumps.
3678         * pthread.c: Correctly handle missing SIGRTMIN.
3680 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3682         * libpthread.map: Add __libc_internal_tsd_get and
3683         __libc_internal_tsd_set.  Add missing cancelable functions. Export
3684         libc internal versions of the cancelable functions.
3686 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
3688         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
3690 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
3692         * attr.c: Implement pthread_attr_[gs]etguardsize,
3693         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
3694         Change pthread_attr_init to have two interfaces.
3695         * internals.h (struct _pthread_descr_struct): Add new fields for
3696         above functions.
3697         * libpthread.map: Add names in GLIBC_2.1 section.
3698         * manager.c (pthread_handle_create): Implement guardsize and
3699         user stack.
3700         (pthread_free): Likewise.
3701         * pthread.c (pthread_create): Add new interface for changed
3702         pthread_attr_t.
3703         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
3704         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
3705         PTHREAD_STACK_MIN.
3707 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
3709         * manager.c: Enable resetting of the thread scheduling policy
3710         to SCHED_OTHER when the parent thread has a different one.
3712 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
3714         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3715         _POSIX_ASYNCHRONOUS_IO.
3717         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
3718         mutexes.
3719         * mutex.c: Implement new mutex types.
3721         * internals.h: Include <signal.h>.
3723         * libpthread.map: Add __erno_location and __h_errno_location.
3725         * errno.c: Return pointer to variable actually in use.  This might
3726         not be the one in the thread structure.
3727         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
3728         and p_h_errnop.
3729         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
3730         of manager thread structure.
3731         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
3732         thread.
3733         * pthread.c: Adapt initializer for thread structures.
3734         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
3735         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
3736         current thread to global variables.
3738 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
3740         * rwlock.c: New file.
3741         * Makefile (libpthread-routines): Add rwlock.
3742         * sysdeps/pthread/pthread.h: Define data structures and declare
3743         functions.
3744         * libpthread.map: Add new functions.
3746 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
3748         * sysdeps/arm/pt-machine.h: New file; add ARM support.
3749         * sysdeps/arm/Implies: likewise.
3750         * README: Document it.
3752 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3754         * signals.c: Remove unneeded initializer for sigwaited, saving a
3755         warning.
3757 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3759         * semaphore.c (sem_init): Set sem_spinlock only if available.
3761 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
3763         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3764         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3766         * Makefile: Update from LinuxThreads 0.7.
3767         * internals.h. Likewise.
3768         * manager.c: Likewise.
3769         * mutex.c: Likewise.
3770         * pthread.c: Likewise.
3771         * signals.c: Likewise.
3772         * specific.c: Likewise.
3773         * Examples/ex3.c: Likewise.
3775 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
3777         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3778         open.
3780 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
3782         * wrapsyscall.c: Add socket functions which are also cancelation
3783         points.
3785 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
3787         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
3788         New functions for fast thread specific data within libc.
3790         * internals.h: Add new array p_libc_specific to struct
3791         _pthread_descr_struct.
3793         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
3795 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
3797         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
3798         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
3800 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
3802         * internals.h (struct _pthread_descr_struct): Add definitions for
3803         two-level specific key handling.
3804         * manager.c (pthread_handle_create): Initialize specific memory array.
3805         * specific.c: Implement two-level key handling.
3806         * weaks.c: Don't provide dummy key handling.
3807         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
3808         Add definition of __libc_key_t.
3809         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
3810         as 1024.
3811         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
3812         PTHREAD_DESTRUCTOR_ITERATIONS.
3814         * manager.c (pthread_handle_create): Compare mmap result with
3815         MAP_FAILED.
3817         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
3818         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
3820 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
3822         sysdeps/sparc -> sysdeps/sparc/sparc32
3823         sysdeps/sparc64 -> sysdeps/sparc/sparc64
3825         * internals.h: Change definition of THREAD_SELF to be an expression,
3826         not a statement that did a return.
3827         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
3828         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
3829         Follow Solaris and use a "system reserved" register (%g6) to hold
3830         the thread descriptor.
3831         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3833 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
3835         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
3836         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
3837         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
3839         * semaphore.c: Include spinlock.h only when needed.
3841         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
3842         keys for entries not in use.
3844         * weaks.c: Implement key handling functions for real.
3846 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
3848         Initial sparc64-linux support:
3849         * sysdeps/sparc64/Implies: New file.
3850         * sysdeps/sparc64/pt-machine.h: Likewise.
3852 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
3854         * semaphore.c: Include spinlock.h at correct place.
3855         Patch by HJ Lu.
3857 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
3859         The Great Bit File Move:
3860         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
3861         * sysdeps/powerpc/semaphorebits.h: Likewise.
3862         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
3863         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
3864         * sysdeps/pthread/libc-lock.h: -> bits/
3865         * sysdeps/pthread/stdio-lock.h: Likewise.
3866         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
3867         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
3868         * semaphore.h: Likewise.
3869         * sysdeps/pthread/pthread.h: Likewise.
3871         * lockfile.c: <foo.h> -> <bits/foo.h>.
3872         * semaphore.h: Likewise.
3874         * Makefile: (headers): foo.h -> bits/foo.h.
3875         * sysdeps/pthread/Makefile: Likewise.
3877 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3879         * semaphore.c (sem_init): Set sem_spinlock only if available.
3881         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
3882         asm constraints.
3884 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
3886         Update from LinuxThreads 0.6.
3888         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
3889         and __sched_get_priority_min instead of names without `__'.
3891         * manager.c: Rewrite large parts to implement opaque pthread_t.
3893         * cancel.c: Adapt for opaque pthread_t type.
3894         * condvar.c: Likewise.
3895         * errno.c: Likewise.
3896         * join.c: Likewise.
3897         * mutex.c: Likewise.
3898         * pthread.c: Likewise.
3899         * signals.c: Likewise.
3900         * specific.c: Likewise.
3901         * restart.h: Likewise.
3902         * queue.h: Likewise.
3903         * Examples/ex3.c: Likewise.
3904         * Examples/ex4.c: Likewise.
3905         * sysdeps/pthread/pthread.h: Likewise.
3907         * pthread.c: Accumulate time for all threads in thread manager.
3909         * semaphore.c: Implement fallback implementation for architectures
3910         sometimes missing compare-exchange operations.
3912         * cancel.c (pthread_cancel): Validate handle argument.
3913         * join.c (pthread_join): Likewise.
3914         (pthread_detach): Likewise.
3915         * signals.c (pthread_kill): Likewise.
3917         * spinlock.h (acquire): Use __sched_yield not sched_yield.
3919         * queue.h (enqueue): Enqueue thread according to priority.
3921         * internals.c (struct pthread_start_args): New struct for passing
3922         args to cloning function.
3923         (struct _pthread): Rename to _pthread_descr_struct and adapt for
3924         opaque pthread_t.
3926         * Examples/Makefile (clean): Pass -f option to rm.
3928         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
3929         and define TEST_FOR_COMPARE_AND_SWAP.
3930         * sysdeps/i386/i486/pt-machine.h: Removed.
3932         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
3933         to 1024.
3935 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
3937         * restart.h (suspend): Clear p_signal before suspending.
3938         (suspend_with_cancellation): Likewise.
3939         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
3941         * weaks.c: Make __pthread_key_create return 1.
3942         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
3943         __libc_getspecific, __libc_setspecific, and __libc_key_t.
3944         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
3945         using libio.
3947 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
3949         * sysdeps/sparc/pt-machine (RELEASE): Fix.
3951 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
3953         * sysdeps/powerpc/Implies: Added.
3954         * sysdeps/powerpc/pt-machine.h: Added.
3955         * sysdeps/powerpc/semaphorebits.h: Added.
3957 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
3959         * pthread.c (__pthread_initial_thread): Correct
3960         initializer.
3961         (__pthread_manager_thread): Likewise.
3962         Reported by Andreas Jaeger.
3964 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
3966         Since sigset_t no longer fits in a register, we can't pass in the
3967         thread's initial mask so easily.  Take this opportunity to simplify
3968         the clone implementation by only accepting a single void* argument.
3970         * manager.c (__pthread_manager): Put thread vitals in the thread
3971         struct instead of as arguments through clone.
3972         (pthread_start_thread): Look for them there.
3973         * internals.h (struct _pthread): Add p_initial_fn,
3974         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
3975         * pthread.c (pthread_initialize_manager): Revise clone invocation.