* sysdeps/unix/readdir.c: Make sure we don't modify errno when we reached EOF.
[glibc.git] / linuxthreads / ChangeLog
blob371bd4b8f5681cf8ee9012264c15e7a228a3c087
1 2001-04-24  Andreas Jaeger  <aj@suse.de>
3         * wrapsyscall.c: send* and recv* return ssize_t.
5         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
6         mutex instead of double locking it.
7         Reported by Pierre Artaud <partaud@sodatec.com>.
9 2001-04-23  Ulrich Drepper  <drepper@redhat.com>
11         * sysdeps/pthread/getcpuclockid.c: Make function generic, test
12         using #ifdef whether the clock is available.
13         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
15         * sysdeps/ia64/Versions: New file.
17         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
18         have to call __gmon_start__ in the libpthread DSO.
19         * sysdeps/pthread/pt-initfini.c (_init): Likewise.
21         * Makefile (libpthread-routines): Add ptclock_gettime and
22         ptclock_settime.
23         * internals.h: Don't use cpuclock-init.h definitions, use
24         hp-timing.h definitions.
25         * pthread.c: Likewise.
26         * manager.c: Likewise.
27         * ptclock_gettime.c: New file.
28         * ptclock_settime.c: New file.
29         * internals.h: Fix parameter type for __pthread_clock_gettime and
30         __pthread_clock_settime.
32         * sysdeps/i386/i586/ptclock_gettime.c: Removed.
33         * sysdeps/i386/i586/ptclock_settime.c: Removed.
34         * sysdeps/i386/i586/Makefile: Removed.
36 2001-04-22  Ulrich Drepper  <drepper@redhat.com>
38         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
39         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
41 2001-04-21  Andreas Jaeger  <aj@suse.de>
43         * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
44         attribute, remove statements that will never be executed.
45         (thread_func): Remove mutex_unlock call since it's never executed.
46         (thread_func): Fix comment as suggested by Jakub Jelinek.
48         * manager.c (__pthread_manager): Add noreturn
49         attribute.
50         (pthread_start_thread): Likewise, remove return statement.
51         (pthread_start_thread_event): Likewise.
52         Add noreturn attribute for pthread_handle_exit.
53         * weaks.c: Add noreturn attribute for pthread_exit.
55         * internals.h: Add __pthread_clock_gettime and
56         __pthread_clock_settime prototypes.
58 2001-04-21  Ulrich Drepper  <drepper@redhat.com>
60         * internals.h: Include <cpuclock-init.h>.
61         (struct _pthread_descr_struct): Add p_cpuclock_offset field if
62         CPUCLOCK_VARDEF is defined.
63         * pthread.c (__pthread_initialize_minimal): Initialize
64         p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
65         * manager.c (pthread_start_thread): Set p_cpuclock_offset field
66         for new thread to current CPU clock value.
68         * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
70         * sysdeps/i386/i586/Makefile: New file.
71         * sysdeps/i386/i586/Versions: New file.
72         * sysdeps/i386/i586/ptclock_gettime.c: New file.
73         * sysdeps/i386/i586/ptclock_settime.c: New file.
74         * sysdeps/i386/i686/Implies: New file.
76 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
78         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
79         $generated, not $postclean-generated.
81 2001-04-18  Andreas Jaeger  <aj@suse.de>
83         * Makefile (otherlibs): Added.
85 2001-04-18  Jakub Jelinek  <jakub@redhat.com>
87         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
89 2001-04-16  Ulrich Drepper  <drepper@redhat.com>
91         * signals.c (sigwait): NSIG is no signal number.  Block all
92         signals while in signal handler for signals in SET.
93         Patch by Manfred Spraul <manfred@colorfullife.com>.
95 2001-04-12  Ulrich Drepper  <drepper@redhat.com>
97         * tst-cancel.c: Disable most tests.  Add new test where all
98         cleanup handlers must run.
99         * Makefile (tests): Add tst-cancel again.
101         * cancel.c (__pthread_perform_cleanup): Correct condition for
102         leaving cleanup loop early.
104         * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
105         all the files which use CURRENT_STACK_FRAME.
106         * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
107         __builtin_frame_address.
108         * sysdeps/i386/i686/pt-machine.h: Likewise.
110 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
112         * Makefile (tests): Comment out tst-cancel for now.
114         * tst-cancel.c (main): Cleanup 4 is supposed to run.  Create
115         temporary file in object directory.
116         * Makefile: Don't allow inlining when compiling tst-cancel.c.
117         Pass $(objpfx) to tst-cancel.
119 2001-04-11  David S. Miller  <davem@redhat.com>
121         * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
122         up closer to user local variables so that new cleanup heuristics work.
123         * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
125 2001-04-11  Ulrich Drepper  <drepper@redhat.com>
127         * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
128         and remove it.
129         (_pthread_cleanup_push_defer): Likewise.
131         * tst-cancel.c (main): Fix loop printing cleanup output.
133 2001-04-10  kaz Kojima  <kkojima@rr.iij4u.or.jp>
135         * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
136         test.
137         (__pthread_spin_trylock): Likewise.
138         * sysdeps/sh/pt-machine.h (testandset): Likewise.
140 2001-04-10  Ulrich Drepper  <drepper@redhat.com>
142         * join.c (pthread_exit): Move code to new function __pthread_do_exit
143         which takes an extra parameter with the current frame pointer.
144         Call new function with CURRENT_STACK_FRAME.
145         (__pthread_do_exit): New function.  Call __pthread_perform_cleanup
146         with the new parameter.
147         (pthread_join): Call __pthread_do_exit instead of pthread_exit.
148         * cancel.c (__pthread_perform_cleanup): Takes extra parameter.  Use
149         this parameter as the initial value the cleanup handler records are
150         compared against.  No active cleanup handler record must have an
151         address lower than the previous one and the initial record must be
152         above (below on PA) the frame address passed in.
153         (pthread_setcancelstate): Call __pthread_do_exit instead of
154         pthread_exit.
155         (pthread_setcanceltype): Likewise.
156         (pthread_testcancel): Likewise.
157         (_pthread_cleanup_pop_restore): Likewise.
158         * condvar.c (pthread_cond_wait): Likewise.
159         (pthread_cond_timedwait_relative): Likewise.
160         * manager.c (pthread_start_thread): Likewise.
161         * oldsemaphore.c (__old_sem_wait): Likewise.
162         * pthread.c (pthread_handle_sigcancel): Likewise.
163         * semaphore.c (__new_sem_wait): Likewise.
164         (sem_timedwait): Likewise.
165         * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
166         to limit the cleanup handlers which get run.
167         * internals.h: Add prototype for __pthread_do_exit.  Adjust prototype
168         for __pthread_perform_cleanup.
170         * Makefile (tests): Add tst-cancel.
171         * tst-cancel.c: New file.
173 2001-04-08  Hans-Peter Nilsson  <hp@axis.com>
175         * sysdeps/cris/pt-machine.h: New file.
176         * sysdeps/cris/pspinlock.c: New file.
178 2001-04-09  Hans-Peter Nilsson  <hp@axis.com>
180         * shlib-versions: Add case for Linux on CRIS.
182 2001-03-26  Ulrich Drepper  <drepper@redhat.com>
184         * attr.c (pthread_getattr_np): Correct computation of stack size
185         for machiens with register stack.
187         * Examples/ex17.c (main): Correct detection of failed mmap call.
189 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
191         * pthread.c (__pthread_initialize_manager): Fix a typo.
193 2001-03-21  Jakub Jelinek  <jakub@redhat.com>
195         * attr.c (__pthread_attr_setstack): Fix alignment check.
196         (pthread_getattr_np): __stackaddr is top of stack, not bottom.
197         * Makefile (tests): Add ex17 test.
198         * Examples/ex17.c: New test.
200 2001-03-20  Ulrich Drepper  <drepper@redhat.com>
202         * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
203         * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
204         * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
206 2001-03-18  Ulrich Drepper  <drepper@redhat.com>
208         * Makefile: When generating DSO link with libc_nonshared.a.
210 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
212         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
214 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
216         * internals.h (__pthread_init_max_stacksize): New prototype.
217         * attr.c (__pthread_attr_setstacksize): Call
218         __pthread_init_max_stacksize if not yet initialized.
219         * pthread.c (__pthread_init_max_stacksize): New function.
220         (__pthread_initialize_manager): Call it.
221         Patch by <dtc@cmucl.cons.org>.
223 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
225         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
227 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
229         * shlib-versions: Add rule for Linux on 64 bit S/390.
230         * sysdeps/s390/s390-64/pt-machine.h: New file.
231         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
233 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
235         * sysdeps/s390/pt-machine.h: Move to...
236         * sysdeps/s390/s390-32/pt-machine.h: ...here.
237         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
239 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
241         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
242         * attr.c: Implement pthread_getattr_np.
243         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
244         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
245         * manager.c (pthread_handle_create): Initialize p_inheritsched.
247 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
249         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
250         code alignment.
252 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
254         * manager.c (manager_mask): Removed static vesion.  Now always local
255         to __pthread_manager().
256         (manager_mask_all): Removed completely.
257         (__pthread_manager): Remove manager_mask_all initialization.
258         (pthread_handle_create): Remove code to set and reset signal mask
259         around __clone2() calls.
261 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
263         * spinlock.c (__pthread_lock): Force lock->__status to be read from
264         memory on every spin.
266 2001-02-10  Andreas Jaeger  <aj@suse.de>
268         * Makefile (extra-objs): New.
270 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
272         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
273         __pthread_initialize_minimal prototype.
275 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
277         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
279 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
281         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
283 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
285         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
286         broken code.  Patch by Jes Sorensen.
288 2001-02-06  Andreas Jaeger  <aj@suse.de>
290         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
291         to...
292         * internals.h: ...here.
294 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
296         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
298 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
300         * Versions: Remove __pthread_initialize_minimal.
302 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
304         * Makefile: Add rules to build crti.o and make it being used in
305         building libpthread.so.
306         * sysdeps/i386/Makefile: New file.
307         * sysdeps/pthread/pt-initfini.c: New file.
309         * pthread.c: Cleanups.
311 2001-01-28  Andreas Jaeger  <aj@suse.de>
313         * oldsemaphore.c (__old_sem_init): Adjust for last change.
314         * sysdeps/pthread/bits/libc-lock.h: Likewise.
315         * spinlock.c: Likewise.
317 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
319         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
320         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
321         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
322         * pthread.c: Likewise.
323         * spinlock.h: Likewise.
324         * sysdeps/pthread/pthread.h: Likewise.
326 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
328         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
329         as struct __pthread_attr_s.
331         * semaphore.h (sem_t): Cleanup namespace, rename status and
332         spinlock elements.
334 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
336         * pthread.c (pthread_onexit_process): Clear
337         __pthread_manager_thread_bos after freeing it.
338         * Makefile (tests): Add ex16.
339         * Examples/ex16.c: New file.
341 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
343         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
344         -z nodelete.
345         * pthread.c (pthread_exit_process): Rename to...
346         (pthread_onexit_process): ...this.
347         (pthread_atexit_process, pthread_atexit_retcode): New.
348         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
349         and only if HAVE_Z_NODELETE is not defined.
350         (__pthread_initialize_manager): Register pthread_atexit_retcode
351         with __cxa_atexit.
353 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
355         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
357 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
359         * Makefile (tests): Add ex15.
360         * Examples/ex15.c: New test.
362 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
364         * pthread.c (pthread_exit_process): Free memory allocated for
365         manager stack.
367 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
369         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
370         (pthread_free): Always unmap the stack.  It's safe now that we don't
371         use MAP_FIXED to allocate stacks.
373 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
375         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
377         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
379 2000-11-15  Wolfram Gloger  <wg@malloc.de>
381         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
382         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
384 2000-12-27  Andreas Jaeger  <aj@suse.de>
386         * Examples/ex13.c: Make local functions static.
387         * ecmutex.c: Likewise.
388         * joinrace.c: Likewise.
389         * Examples/ex14.c: Likewise.
391         * Examples/ex2.c: Make local functions static; reformat.
392         * Examples/ex1.c: Likewise.
393         * Examples/ex4.c: Likewise.
394         * Examples/ex5.c: Likewise.
395         * Examples/ex7.c: Likewise.
397         * oldsemaphore.c: Add prototypes to shut up GCC.
398         * pt-machine.c: Likewise.
400         * weaks.c: Add prototype for pthread_exit.
402         * internals.h: Add some prototypes, format prototypes and add
403         missing externs.
404         Move __libc_waitpid prototype to include/sys/wait.h.
406         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
407         * mutex.c: Likewise.
408         * specific.c: Likewise.
409         * ptfork.c: Likewise.
411         * lockfile.c: Include internals.h to get prototypes.
412         * events.c: Likewise.
413         * sysdeps/alpha/pspinlock.c: Likewise.
414         * sysdeps/arm/pspinlock.c: Likewise.
415         * sysdeps/hppa/pspinlock.c: Likewise.
416         * sysdeps/i386/pspinlock.c: Likewise.
417         * sysdeps/ia64/pspinlock.c: Likewise.
418         * sysdeps/m68k/pspinlock.c: Likewise.
419         * sysdeps/mips/pspinlock.c: Likewise.
420         * sysdeps/powerpc/pspinlock.c: Likewise.
421         * sysdeps/s390/pspinlock.c: Likewise.
422         * sysdeps/sh/pspinlock.c: Likewise.
423         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
424         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
425         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
427 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
429         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
430         (__pthread_attr_getstack): Return correct address.
431         Add warnings for using pthread_attr_getstackaddr and
432         pthread_attr_setstackaddr.
434 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
436         * Examples/ex6.c (test_thread): Make static.
437         * Examples/ex12.c (test_thread): Make static and add noreturn
438         attribute.
440 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
442         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
443         and compare_and_swap_with_release_semantics returns int not long.
445 2000-12-17  Andreas Jaeger  <aj@suse.de>
447         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
448         value.
449         * sysdeps/arm/pt-machine.h (testandset): Likewise.
450         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
451         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
452         * sysdeps/sh/pt-machine.h (testandset): Likewise.
453         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
454         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
456 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
458         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
459         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
461 2000-12-17  Andreas Jaeger  <aj@suse.de>
463         * internals.h: Add prototypes for testandset and
464         __compare_and_swap to shut up gcc warnings.
466 2000-12-06  Wolfram Gloger  <wg@malloc.de>
468         * join.c (pthread_detach): Allow case where the thread has already
469         terminated.
471 2000-12-05  Andreas Jaeger  <aj@suse.de>
473         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
474         * sysdeps/mips/pt-machine.h (testandset): Likewise.
475         (__compare_and_swap): Likewise.
476         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
478 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
480         * Examples/ex3.c (main): Cast int to long before casting to void *.
481         (search): Cast void * to long, not int.
482         * Examples/ex8.c (main, thread): Similarly.
483         * Examples/ex11.c (main): Similarly.
484         * Examples/ex14.c (worker, do_test): Similarly.
485         * ecmutex.c (worker, do_test): Similarly.
486         (nlocks): Cast to int.
488 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
490         * linuxthreads.texi:  Add documentation for pthreads attributes
491         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
492         patch.  Document pthread_[sg]etconcurrency().  Mark
493         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
495 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
497         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
498         Don't define it.
499         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
500         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
502 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
504         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
505         not doing it right now.
506         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
508 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
510         * Examples/ex4.c (main): Don't use exit() to avoid warning with
511         broken compilers.
513 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
515         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
516         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
518         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
519         discussing mutexes. (As per the Unix98 name for the API.)
520         Changes documentation for pthread_mutexattr_setkind_np() and
521         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
522         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
523         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
524         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
525         Begins to introduce discussion of the ``timed'' mutex type.  This
526         discussion is currently incomplete.
527         Patch by Bruce Mitchener <bruce@cubik.org>.
529 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
530             Yutaka Niibe  <gniibe@chroot.org>
532         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
533         has restrictions, use register.
535 2000-10-23  Andreas Schwab  <schwab@suse.de>
537         * Examples/ex14.c (TIMEOUT): Override default timeout.
539 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
541         * specific.c: Protect tsd array modification in thread data
542         structures by getting the thread lock in pthread_key_delete and
543         __pthread_destroy_specifics.
544         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
546 2000-10-12  Alan Modra <alan@linuxcare.com.au>
548         * sysdeps/pthread/bits/initspin.h: New file.
549         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
550         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
551         (__pthread_alt_init_lock): Likewise.
552         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
554 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
556         * oldsemaphore.c (__old_sem_init): Release lock with
557         LT_SPINLOCK_INIT, not zero.
558         * spinlock.c (__pthread_unlock): Likewise.
559         (__pthread_alt_lock): Likewise.
560         (__pthread_alt_timedlock): Likewise.
561         (__pthread_alt_unlock): Likewise.
562         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
563         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
564         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
565         LT_SPINLOCK_INIT do initialize spinlocks not 0.
567 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
569         * shlib-versions: Add version definitions for hppa-linux.
571 2000-10-12  Alan Modra <alan@linuxcare.com.au>
573         * sysdeps/hppa/pspinlock.c: New file.
574         * sysdeps/hppa/pt-machine.h: New file.
575         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
577 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
579         * mutex.c (__pthread_mutex_destroy): Correct test of
580         busy mutex for mutexes using alternate fastlocks.
581         Patch by dtc@cmucl.cons.org.
583 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
585         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
587 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
589         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
590         test for owner first.
591         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
593         * cancel.c (pthread_cancel): Don't do anything if cancelation is
594         disabled.
596 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
598         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
599         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
601         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
602         _POSIX_MONOTONIC_CLOCK.
604         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
605         and explain why.
607 2000-09-20  Andreas Jaeger  <aj@suse.de>
609         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
610         "testrtsig.h" conditional.
612 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
614         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
615         pthread_attr_setstack.
616         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
617         pthread_attr_setstack.
618         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
620 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
622         * Examples/ex14.c: New file.
623         * Makefile (tests): Add ex14.
625         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
626         mutex.  Patch by dtc@cmucl.cons.org.
628         * ecmutex.c: New file.
629         * Makefile (tests): Add ecmutex.
631 2000-09-04  H.J. Lu  <hjl@gnu.org>
633         * attr.c (__pthread_attr_setguardsize): Use page_roundup
634         instead of roundup to round up to the page size.
636 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
638         * manager.c (pthread_exited): Correctly report event as TD_REAP
639         instead of TD_DEATH.  Fix comments.
641 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
643         * spinlock.h (testandset): Add cast to avoid warning.
644         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
646 2000-09-02  Andreas Jaeger  <aj@suse.de>
648         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
649         prototype.
651 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
653         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
654         Fix typo in last patch (_mode -> _flags).
656         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
657         Provide definition which respects _IO_USER_LOCK flag.
659 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
661         * manager.c (pthread_allocate_stack): Clear descriptor only if not
662         mmaped.
664 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
666         * Makefile: Add rules to build and run unload.
667         * unload.c: New file.
669         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
671         * sysdeps/pthread/pthread.h
672         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
673         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
675 2000-08-24  Andreas Jaeger  <aj@suse.de>
677         * Examples/ex13.c: Include <string.h> for strerror prototype and
678         <stdlib.h> for abort prototype.
679         (pthr_cond_signal_mutex): Rewrite to silence GCC.
680         (thread_start): Remove unused variable err.
681         (main): Silence GCC warnings.
683 2000-08-22  Andreas Jaeger  <aj@suse.de>
685         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
687         * Makefile (tests): Add ex13.
689 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
691         * semaphore.h: Add restrict where required by AGd4.
692         * sysdeps/pthread/pthread.h: Likewise.
693         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
695 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
697         * Makefile (tests): Add ex12.  Add rule to build it.
698         * Examples/ex12.c: New file.
700 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
702         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
703         even though the implementation is not quite complete (but it reports
704         it).  Define _POSIX_MESSAGE_PASSING to -1.
705         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
707 2000-08-12  Andreas Jaeger  <aj@suse.de>
709         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
710         assembler.
711         (__compare_and_swap): Likewise.
712         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
714 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
716         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
717         p_h_errnop correctly and not to NULL.
719 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
721         * Banner: Bump version number to 0.9.
723 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
725         * Makefile (tests): Add tststack.  Add rule to build the program.
726         * tststack.c: New file.
728         * internals.h: Declare __pthread_max_stacksize.
729         * pthread.c (__pthread_max_stacksize): New variable.
730         (__pthread_initialize_manager): Determine __pthread_initialize_manager
731         value.
732         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
733         (pthread_allocate_stack): Allow kernel to choose stack address if
734         FLOATING_STACKS.  This also handles variable-sized stacks.
735         Always allocate stack and guardpage together.  Use mprotect to
736         change guardpage access.
737         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
738         ARCH_STACK_MAX_SIZE.
740         * attr.c (__pthread_attr_setstacksize): Also test value against
741         upper limit.
743         * manager.c (__pthread_nonstandard_stacks): Define only if
744         THREAD_SELF is not defined.
745         (pthread_allocate_stack): Always initialize gardaddr to a correct
746         value.
747         (pthread_handle_create): Unmap thread with one call.
748         (pthread_free): Remove test for initial thread before removing stack.
749         Unmap stack with one call.
751         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
752         1 to avoid removing the stack.
754 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
756         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
757         load of spin lock to prime the cache before the atomic compare and
758         exchange operation (cmpxchg4). This avoids the spinning on the
759         cmpxchg4 instruction and reduces movement of the cache line back
760         and forth between the processors (explanation by Asis K. Mallick
761         from Intel). This basically makes the implementation operate the
762         same as the Linux kernel implementation.
764         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
765         * sysdeps/ia64/pspinlock.c: New file.
767 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
769         * pthread.c: Move definition of __pthread_set_own_extricate_if...
770         * spinlock.h: ...here.  Remove locking.
771         * internals.h: Remove __pthread_set_own_extricate_if prototype.
773         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
774         (rwlock_rd_extricate_func): Don't determine self, let
775         __pthread_lock do it.
776         (rwlock_wr_extricate_func): Likewise.
777         (rwlock_have_already): Optimize *pself handling a bit.
779         * mutex.c: Use __builtin_expect.
780         * pthread.c: Likewise.
782 2000-08-02  Andreas Jaeger  <aj@suse.de>
784         * sysdeps/s390/pspinlock.c: New file.
785         * sysdeps/s390/pt-machine.h: New file.
786         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
788 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
790         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
791         R3K.
792         * sysdeps/mips/pt-machine.h (testandset): Likewise.
794 2000-07-26  Andreas Jaeger  <aj@suse.de>
796         * pthread.c: Initialize p_sem_avail.
798 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
800         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
801         * semaphore.c: Handle spurious wakeups.
803         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
804         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
806         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
807         (__pthread_wait_for_restart): Likewise.
809         * condvar.c (pthread_cond_wait): Also check whether thread is
810         cancelable before aborting loop.
811         (pthread_cond_timedwait): Likewise.
813         * signals.c (pthread_sighandler): Remove special code to restrore
814         %gs on x86.
815         (pthread_sighandler_t): Likewise.
817 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
819         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
820         * pthread.c: Include <resolv.h>.
821         (_res): Undefine.  Add extern declaration.
823 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
825         * pthread.c (__pthread_initial_thread): Update initializer.
826         (__pthread_manager_thread): Likewise.
827         (pthread_initialize): Move setrlimit call to...
828         (__pthread_initialize_manager): ...here.
829         (__pthread_reset_main_thread): Reset also soft limit on stack size.
831         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
832         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
834 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
836         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
837         __compare_and_swap to define testandset.
838         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
839         Define IMPLEMENT_TAS_WITH_CAS.
841 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
843         * Makefile: Pass -z nodelete to linker for libpthread.so
844         generation if it understand this option.
846 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
848         * manager.c (pthread_handle_create): Remove initialization of
849         new_thread->p_res._sock.
851 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
853         Bugfixes to the variant of the code for machines with no compare
854         and swap.
856         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
857         node was not being properly enqueued, due to failing to update
858         the lock->__status field.
860         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
861         being set inappropriately, causing the suspend function to be called
862         with a null self pointer and crash.
864 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
866         * spinlock.h (__pthread_alt_trylock): Fix code used if no
867         compare&swap is available.
869         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
870         compare_and_swap.
872         * pthread.c (pthread_initialize): Don't use sysconf to determine
873         whether the machine has more than one processor.
875         * spinlock.c (__pthread_alt_timedlock): Add back one of the
876         removed thread_self calls.
878 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
880         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
881         __compare_and_swap to compare_and_swap in code which assumes
882         compare swap is available.
884 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
886         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
887         bug whereby thr field of waitnode structure would not be correctly
888         set unless a null self pointer is passed to the functions.
889         Eliminated redundant calls to thread_self().
891 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
893         * pthread.c (__pthread_initialize_manager): Lock
894         __pthread_manager_thread.p_lock before calling clone.
896 2000-05-05  H.J. Lu  <hjl@gnu.org>
898         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
899         have acquire semantics.
900         (__compare_and_swap_with_release_semantics): New inline
901         function.
902         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
904 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
906         * manager.c: Fix the problem with signals at startup.
907         Change the way that thread stacks are allocated on IA64.
908         Clean up some of the guard page allocation stuff.
910 1999-12-19  H.J. Lu  <hjl@gnu.org>
912         * internals.h (page_roundup): New.
913         * attr.c (__pthread_attr_setguardsize); Use page_roundup
914         instead of roundup.
915         * manager.c (pthread_allocate_stack): Make sure guardaddr is
916         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
917         is define.
919 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
921         * manager.c (pthread_allocate_stack): Unmap the stack top
922         if failed to map the stack bottom.
923         Fix the guard page.
924         (pthread_free): Fix the guard page.
926         * pthread.c (pthread_initialize): Set rlimit correctly for
927         NEED_SEPARATE_REGISTER_STACK.
929 1999-12-16  H.J. Lu  <hjl@gnu.org>
931         * pthread.c (__pthread_initialize_manager): Pass
932         __pthread_manager_thread_bos instead of
933         __pthread_manager_thread_tos to __clone2.
935 1999-12-16  H.J. Lu  <hjl@gnu.org>
937         * manager.c (pthread_allocate_stack): Correct the calculation
938         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
939         stack bottom.
941 1999-12-13  H.J. Lu  <hjl@gnu.org>
943         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
944         bit after setting ar.ccv.
946 1999-12-12  H.J. Lu  <hjl@gnu.org>
948         * manager.c (pthread_allocate_stack): Make the starting
949         address of the stack bottom page aligned. FIXME: it may
950         need changes in other places.
951         (pthread_handle_create): Likewise.
953 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
955         * manager.c (pthread_allocate_stack): Handle
956         NEED_SEPARATE_REGISTER_STACK.
957         (pthread_handle_create): Likewise.
958         * pthread.c (__pthread_initialize_manager): Likewise.
960         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
962 1999-12-02  H.J. Lu  <hjl@gnu.org>
964         * sysdeps/ia64/pt-machine.h: New.
966 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
968         * wrapsyscall.c: Mark non-__ protected names as weak.
969         PR libc/1466.
971 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
973         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
975 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
977         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
978         Add tests also to new alternative spinlock implementation.
979         * spinlock.h: Likewise.
980         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
982 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
984         * Version: Export __sigaction.
985         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
986         of __sigaction.
987         * pthread.c: Use __libc_sigaction instead of __sigaction.
989         * condvar.c: Implement pthread_condattr_getpshared and
990         pthread_condattr_setpshared.
991         * mutex.c: Implement pthread_mutexattr_getpshared and
992          pthread_mutexattr_setpshared.
993         * Versions: Export new functions.
994         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
996         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
997         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
998         is not selected.
1000 2000-07-04  Greg McGary  <greg@mcgary.org>
1002         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
1003         pragmas.  Include bp-sym.h only if _LIBC.
1005 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
1007         * spinlock.c (__pthread_unlock): Properly place write barrier.
1008         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1010 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
1012         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
1013         faster on SMP systems.  No more emulation of compare&swap for adaptive
1014         spinlocks.
1015         * spinlock.h: Likewise.
1016         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
1017         Replace fast with adaptive mutex.
1018         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
1019         * condvar.c: Likewise.
1020         * pthread.c: Define and initialize __pthread_smp_kernel variable.
1021         * internals.h: Declare __pthread_smp_kernel.
1022         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
1023         _pthread_fastlock structure.
1024         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1026         * pthread.c: Remove initialization to zero from global variables.
1028 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
1030         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
1032 2000-06-28  Greg McGary  <greg@mcgary.org>
1034         * weaks.c: Wrap BP_SYM () around weak extern declarations of
1035         pthread functions that have pointers in their return+arg signatures.
1037 2000-06-27  Greg McGary  <greg@mcgary.org>
1039         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
1040         extern declarations of pthread functions that have pointers in
1041         their return+arg signatures.
1043 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
1045         * Makefile (tests): Add ex11.  Add rules to build it.
1046         * Examples/ex11.c: New file.
1047         * rwlock.c: Fix complete braindamaged previous try to implement
1048         timedout functions.
1050         * spinlock.c: Pretty print.
1052 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
1054         * Makefile (tests): Add ex10.  Add rules to build it.
1055         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
1056         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
1057         * condvar.c (pthread_cond_wait): Allow mutex of kind
1058         PTHREAD_MUTEX_TIMED_NP.
1059         (pthread_cond_timedwait_relative): Likewise.
1060         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
1061         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
1062         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1063         (__pthread_mutex_lock): Use __pthread_alt_lock for
1064         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1065         (__pthread_mutex_timedlock): New function.
1066         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
1067         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
1068         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
1069         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
1070         * spinlock.c: Implement alternate fastlocks.
1071         * spinlock.h: Add prototypes.
1072         * Examples/ex10.c: New file.
1073         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1074         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1076         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
1077         (__pthread_rwlock_timedrdlock): New function.
1078         (__pthread_rwlock_timedwrlock): New function.
1079         Use laternate fastlock function everywhere.
1081 2000-06-21  Andreas Jaeger  <aj@suse.de>
1083         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
1084         prototype.
1086         * join.c: Include <stdlib.h> for exit prototype.
1088 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
1090         * sysdeps/i386/useldt.h: Include <stdlib.h>.
1092         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
1093         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1095         * Makefile (libpthread-routines): Add barrier.
1096         (tests): Add ex9.  Add rule to build ex9.
1097         * Versions: Export barrier functions.
1098         * barrier.c: New file.
1099         * Examples/ex9.c: New file.
1100         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
1101         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
1102         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1104 2000-06-19  H.J. Lu  <hjl@gnu.org>
1106         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
1107         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
1108         (compare_and_swap_with_release_semantics): New. Default to
1109         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
1110         is not defined.
1112         * spinlock.c (__pthread_unlock): Call
1113         compare_and_swap_with_release_semantics () instead of
1114         compare_and_swap ().
1116 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
1118         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
1119         to errno directly.
1120         * sysdeps/pthread/timer_delete.c: Likewise.
1121         * sysdeps/pthread/timer_getoverr.c: Likewise.
1122         * sysdeps/pthread/timer_gettime.c: Likewise.
1123         * sysdeps/pthread/timer_settime.c: Likewise.
1125 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
1127         Timer nodes are now reference counted, and can be marked
1128         as deleted. This allows for the safe release of the global mutex
1129         in the middle without losing the timer being operated on.
1131         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
1132         member is now an enum with three values, so that an intermediate
1133         state can be represented (deleted but not free for reuse yet).
1134         New refcount member added.
1135         * sysdeps/pthread/timer_routines.c: Likewise.
1137         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
1138         timer_valid): New inline functions added.
1140         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
1141         restructured, recursive deadlock bug fixed.
1143         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
1144         timer_addref to ensure that timer won't be deleted while mutex is not
1145         held. Also uses timer_invalid to perform validation of timer handle.
1146         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
1147         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
1149 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
1151         * shlib-versions: Add entry for SH.
1152         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
1154 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
1156         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
1157         tightened up some critical regions and micro-optimized some list
1158         manipulation code.
1160         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1161         Returns int value now to indicate whether timer was queued at head.
1162         * sysdeps/pthread/posix-timer.h: Likewise.
1163         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
1164         new return value from __timer_thread_queue_timer to avoid waking
1165         up timer thread unnecessarily.
1167         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
1168         inuse flag, because this requires mutex to be held.  Callers updated
1169         to do the check when they have the mutex.
1170         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
1172         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
1173         regions: avoids making system calls while holding timer mutex, and
1174         a few computations were moved outside of the mutex as well.
1175         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
1177         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
1178         to list_unlink_ip, meaning idempotent.  Pointer manipulation
1179         changed to get better better code out of gcc.
1180         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
1181         version of list_unlink added here.
1182         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
1183         function in all places: idempotent one for timers, non-idempotent
1184         one for thread nodes.
1185         * sysdeps/pthread/timer_settime: Likewise.
1186         * sysdeps/pthread/timer_routines.c: Likewise.
1188 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
1190         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
1191         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1193         * sysdeps/pthread/Makefile: Remove tests definition.
1195 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
1196             Yutaka Niibe  <gniibe@chroot.org>
1198         * sysdeps/sh/pspinlock.c: New file.
1199         * sysdeps/sh/pt-machine.h: New file.
1201 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
1203         * Makefile (tests): Add joinrace.
1205         * Examples/ex6.c: Test return value of pthread_join.
1207 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
1209         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
1210         (__pthread_spin_trylock): Implement.
1211         (__pthread_spin_unlock): Implement.
1212         (__pthread_spin_init): Implement.
1213         (__pthread_spin_destroy): Implement.
1215 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
1217         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
1218         really append the entry.
1220 2000-06-10  Andreas Jaeger  <aj@suse.de>
1222         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
1224 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
1226         * sysdeps/pthread/timer_create.c: Thread matching now done on
1227         clock type as well as thread attributes.
1228         There are individual global signal-delivering threads for
1229         different clock types.
1230         * sysdeps/pthread/posix-timer.h: Likewise.
1231         * sysdeps/pthread/timer_routines.c: Likewise.
1233         * sysdeps/pthread/timer_routines.c: Thread allocation and
1234         deallocation function now remembers to put thread on active
1235         list and remove from active list.
1236         Thus now the feature of binding multiple timers
1237         to a single thread actually works.
1239 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
1241         * pthread.c (__pthread_create_2_1): Optimize a bit.
1243         * internals.h (invalid_handle): Also test for p_terminated != 0.
1244         (nonexisting_handle): New function.  Same as old invalid_handle.
1245         * join.c (pthread_join): Use nonexisting_handle instead of
1246         invalid_handle to test for acceptable thread handle.
1247         * manager.c (pthread_handle_free): Likewise.
1248         * joinrace.c: New file.
1249         Reported by Permaine Cheung <pcheung@cygnus.com>.
1251 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
1253         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1254         Correct handling of matching variable.
1256         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
1257         avoid warnings.
1259         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1260         Be prepared for empty timer list.
1262         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
1263         CPUTIME clock ID.  Add support for thread clocks.
1265         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
1266         subtraction were switched.
1268         * sysdeps/pthread/timer_routines.c (init_module): Use
1269         THREAD_MAXNODES threads.
1271         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
1272         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
1273         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
1274         with sigqueueinfo is this system call is available.
1276         * sysdeps/pthread/timer_create.c (timer_create): Allow
1277         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
1279         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
1280         functionality.
1281         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
1283 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
1285         * sysdeps/pthread/posix-timer.h: New file.
1286         * sysdeps/pthread/timer_create.c: New file.
1287         * sysdeps/pthread/timer_delete.c: New file.
1288         * sysdeps/pthread/timer_getoverr.c: New file.
1289         * sysdeps/pthread/timer_gettime.c: New file.
1290         * sysdeps/pthread/timer_routines.c: New file.
1291         * sysdeps/pthread/timer_settime.c: New file.
1292         * sysdeps/pthread/tst-timer.c: New file.
1294 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
1296         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
1297         LINK_MAX definitions if necessary.
1299 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
1301         Added missing fork time handling of global libio lock.
1303         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
1304         not just the individual stream locks. Rewritten to use new
1305         iterator interface provided by libio rather than accessing
1306         global variable.
1308         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
1309         which lock and unlock the stream list using the new interface
1310         provied by libio.
1311         * internals.h: Likewise.
1313         * ptfork.c (__fork): Now calls __flockfilelist before fork,
1314         and __funlockfilelist in the parent after the fork.
1315         Child still calls __fresetlockfiles as before.
1317         * linuxthreads.texi: Now explains what happens to streams at
1318         fork time. Also whole new section on forking and thread added.
1319         Definition of pthread_atfork moved out of Miscellaneous Functions
1320         to this new section.
1322 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
1324         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
1325         Add missing register.
1326         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
1328 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
1330         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
1331         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
1332         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
1334 2000-05-31  Andreas Jaeger  <aj@suse.de>
1336         * sysdeps/mips/pspinlock.c: Implement spinlocks.
1338 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
1340         * spinlock.c (__pthread_lock): Remove ASSERT.
1342         * Makefile (tests): Add ex8.
1343         * Examples/ex8.c: New file.
1345 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
1347         Bugfix: The pthread_atfork mechanism now takes care of its
1348         own internal mutex at fork time.
1350         * ptfork.c (__fork): Revised so that the mutex is held across
1351         the fork operation and while the handlers are called, and so that
1352         the child resets the mutex.
1354         * linuxthreads.texi: Updated pthread_atfork documentation to make
1355         it clear that fork and pthread_atfork can't be reentered from
1356         atfork handlers, that pthread_atfork and fork are mutually atomic,
1357         and that the handlers are inherited by the child process.
1359 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
1361         * Makefile (libpthread-routines): Add pspinlock.
1362         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
1363         Use struct _pthread_fastlock instead of pthread_spinlock_t.
1364         * condvar.c: Likewise.
1365         * internals.h: Likewise.
1366         * join.c: Likewise.
1367         * manager.c: Likewise.
1368         * mutex.c: Likewise.
1369         * pthread.c: Likewise.
1370         * rwlock.c: Likewise.
1371         * semaphore.c: Likewise.
1372         * signals.c: Likewise.
1373         * spinlock.h: Likewise.
1374         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
1375         * sysdeps/alpha/pspinlock.c: New file.
1376         * sysdeps/arm/pspinlock.c: New file.
1377         * sysdeps/i386/pspinlock.c: New file.
1378         * sysdeps/m68k/pspinlock.c: New file.
1379         * sysdeps/mips/pspinlock.c: New file.
1380         * sysdeps/powerpc/pspinlock.c: New file.
1381         * sysdeps/sparc/sparc32/pspinlock.c: New file.
1382         * sysdeps/sparc/sparc64/pspinlock.c: New file.
1383         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
1384         back to _pthread_fastlock.  Define new pthread_spinlock_t.
1386 2000-05-24  Andreas Jaeger  <aj@suse.de>
1388         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
1390 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
1392         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
1394 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
1396         * internals.h (__RES_PTHREAD_INTERNAL): Define.
1398 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
1400         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
1401         object state is represented with additional bits which distinguish
1402         whether that state was set up in the current process, or
1403         in an ancestor process. If that state was set in an ancestor,
1404         it means that a fork happened while thread was executing the init
1405         function. In that case, the state is reset to NEVER.
1406         * mutex.c (__pthread_once_fork_prepare): New function.
1407         (__pthread_once_fork_child): Likewise
1408         (__pthread_once_fork_parent): Likewise
1409         (__pthread_reset_pthread_once): Removed.
1410         * ptfork.c (__fork): Call new handlers in mutex.c.
1411         * internals.h: Declarations of new mutex.c functions added.
1412         Declaration of removed function deleted.
1413         * linuxthreads.texi: Updated documentation about pthread_once
1414         to clarify what happens under cancellation and forking.
1416 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
1418         * internals.h: New thread manager request type, REQ_KICK.
1419         * join.c (pthread_exit): main thread now calls exit() instead
1420         of _exit() in order to proper process cleanup.
1421         * manager.c (__pthread_manager): Do not terminate manager
1422         after unblocking main thread; wait for main thread's
1423         REQ_PROCESS_EXIT request instead.
1424         Also, added REQ_KICK case to handle new request; this just does
1425         nothing.
1426         * manager.c (pthread_exited): Do not terminate manager after
1427         unblocking main thread.
1428         * manager.c (__pthread_manager_sighandler): If the main thread
1429         is waiting for all other threads to die, send a REQ_KICK into
1430         the thread manager request pipe to get it to clean out the threads
1431         and unblock the main thread as soon as possible. This fixes
1432         the 2000 millisecond hang on shutdown bug.
1433         * Examples/ex7.c: New file, tests shutdown behavior when all threads
1434         including the main one call pthread_exit(), or implicitly do so.
1435         * Makefile (tests): Add ex7.
1437 2000-05-05  Andreas Jaeger  <aj@suse.de>
1439         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1440         (pthread_getcpuclockid): Correct test for ourselves.
1442 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
1444         * internals.h (struct _pthread_descr_struct): Reorganization.
1445         Allocate room for 16 pointers at head of the structure for future
1446         thread-local data handling.  Move p_self member in this area.
1447         * manager.c (pthread_handle_create): Adjust use of p_self.
1448         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
1449         * pthread.c (__pthread_initial_thread): Adjust initialization.
1450         (__pthread_manager_thread): Likewise.
1452 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
1454         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
1455         for eventmask larger than 1 word.
1457 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
1459         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
1460         * pthread.c (__pthread_initialize_minimal): New function.  Perform
1461         minimal initialization.
1462         (pthread_initialize): Remove this code here.
1463         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
1464         are working around the problem in glibc.
1466 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
1468         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
1469         now.  First gcc must be fixed (more concrete: libgcc).
1471 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
1473         * pthread.c: Remove special treatement for interrupt handlers on x86.
1474         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
1475         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
1476         necessary.
1477         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
1479 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
1481         * join.c (pthread_exit): Set p_terminated after reporting the
1482         termination event instead of before.
1484 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
1486         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
1487         if __USE_UNIX98.
1489 2000-04-18  Andreas Jaeger  <aj@suse.de>
1491         * Versions: Use ld instead of ld.so.
1493 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
1495         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
1496         Remove the typedef keyword.
1498 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
1500         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
1501         not stbar.
1502         (READ_MEMORY_BARRIER): Define.
1503         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
1504         MEMORY_BARRIER.
1505         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
1506         headers.
1508 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
1510         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1511         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
1512         use thread_handle().
1514 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
1516         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
1517         if fast mutex is used.  Don't initialize `already_canceled' twice.
1518         Correctly test for return value of timedsuspend.
1520         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
1521         therefore don't need the _rt versions of the signal handlers.
1523 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
1525         * pthread.c (pthread_yield): New function.
1526         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
1527         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
1528         * internals.h: Declare __pthread_yield.
1530         * pthread.c (pthread_initialize): Avoid a bit more code if
1531         realtime signals are known to exist.
1533         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
1534         to dynamically detect RT signals and avoid generating compatibility
1535         functions with old kernel.
1536         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
1537         __pthread_restart_new directly.
1538         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
1539         __pthread_wait_for_restart_signal directly.
1540         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
1541         __pthread_timedsuspend_new directly.
1543 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
1545         * condvar.c: Remove all the special code to handle cond_timedwait.
1546         Use timedsuspend instead.
1547         * internals.h: Declare __pthread_timedsuspend_old,
1548         __pthread_timedsuspend_new, and __pthread_timedsuspend.
1549         Remove declaration of __pthread_init_condvar.
1550         * pthread.c: Define __pthread_timedsuspend variable.
1551         (__pthread_timedsuspend_old): New function.  Timed suspension
1552         implementation for old Linux kernels.
1553         (__pthread_timedsuspend_new): New function.  Timed suspension
1554         implementation for new Linux kernels.
1555         * restart.h (timedsuspend): New function.  Call appropriate
1556         suspension function through __pthread_timedsuspend.
1557         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
1558         the code.
1559         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1561         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
1562         undefined.
1563         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
1564         where possible.
1565         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
1566         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1568         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
1569         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1571 2000-04-14  Andreas Jaeger  <aj@suse.de>
1573         * weaks.c: Fix typo.
1575         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
1576         2.2 for linuxthreads.
1578 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
1580         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1581         (pthread_getcpuclockid): Fix typo.
1583 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
1585         * Makefile (libpthread-routines): Add getcpuclockid.
1586         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
1587         * sysdeps/pthread/getcpuclockid.c: New file.
1588         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
1589         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
1591         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
1592         Defined.
1593         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1595         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
1596         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1597         and pthread_spin_unlock.
1598         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
1599         into pthread_spinlock_t.  Change all uses.
1600         * spinlock.c: Implement pthread_spin_lock.
1601         Rename __pthread_unlock to __pthread_spin_unlock and define weak
1602         alias for real name.
1603         Define pthread_spin_trylock, pthread_spin_init, and
1604         pthread_spin_destroy.
1605         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1606         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
1607         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1608         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
1609         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1610         and pthread_spin_unlock.
1611         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
1612         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1613         * condvar.c: Likewise.
1614         * internals.h: Likewise.
1615         * join.c: Likewise.
1616         * manager.c: Likewise.
1617         * mutex.c: Likewise.
1618         * pthread.c: Likewise.
1619         * rwlock.c: Likewise.
1620         * semaphore.c: Likewise.
1621         * signals.c: Likewise.
1623         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
1624         macros.
1625         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1627 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
1629         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
1630         _POSIX_SHARED_MEMORY_OBJECTS.
1632 2000-04-11  Andreas Jaeger  <aj@suse.de>
1634         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
1635         (__compare_and_swap): Mark as modifying memory.
1637 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
1639         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
1640         __volatile__.
1641         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
1642         Don't have the 'asm' __volatile__.
1644 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
1646         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
1647         * spinlock.c (__pthread_lock): Add memory barriers.
1648         (__pthread_unlock): Likewise.
1649         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
1650         instruction.
1651         (RELEASE): Not needed anymore.
1652         (__compare_and_swap): Mark asm as modifying memory.
1653         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
1654         of MEMORY_BARRIER.
1655         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
1656         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
1657         (MEMORY_BARRIER): Define using stbar.
1658         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
1659         stbar.
1660         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
1661         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
1662         Mike Burrows <m3b@pa.dec.com>.
1664 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
1666         * signals.c (sigaction): Fix return value for the case SIG is one
1667         of the signals the implementation uses.
1668         Patch by Xavier.Leroy@inria.fr.
1670 2000-04-01  Andreas Jaeger  <aj@suse.de>
1672         * attr.c: Use shlib-compat macros.
1673         * oldsemaphore.c: Likewise.
1674         * pthread.c: Likewise.
1675         * weaks.c: Likewise.
1677 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
1679         * semaphore.c (sem_timedwait): New function.
1680         Patch by Carl Mailloux <carlm@oricom.ca>.
1681         * semaphore.h: Declare sem_timedwait.
1682         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
1684 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
1686         * sysdeps/pthread/Makefile: File removed.
1688 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
1690         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
1691         * internals.h (__pthread_reset_pthread_once): Add prototype.
1692         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
1694         * manager.c (pthread_handle_create): Store ID of new thread before
1695         clone call.
1697 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
1699         * attr.c: Use new macros from shlib-compat.h to define versions.
1700         * oldsemaphore.c: Likewise.
1701         * semaphore.c: Likewise.
1702         * weaks.c: Likewise.
1704         * pthread.c: Update for new SHLIB_COMPAT definition.
1706         * manager.c (__pthread_manager): Unmask debug signal.
1708         * pthread.c (pthread_initialize): Test for address of __dso_handle
1709         being NULL, not value.  Use __on_exit, not on_exit.
1710         Patch by Andreas Jaeger <aj@suse.de>.
1712         * pthread.c: Use new macros from shlib-compat.h to define versions.
1714 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
1716         * pthread.c (pthread_initialize): Instead of on_exit use
1717         __cxa_atexit if __dso_label is available to allow unloading the
1718         libpthread shared library.
1720 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
1722         * condvar.c: Make tests for ownership of mutex less strict.
1724 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
1726         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
1727         current thread and return error if not.
1728         (pthread_cond_timedwait_relative_old): Likewise.
1729         (pthread_cond_timedwait_relative_new): Likewise.
1731         * mutex.c (__pthread_once): Handle cancelled init function correctly.
1732         (pthread_once_cancelhandler): New function.
1733         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1735 2000-03-14  Andreas Jaeger  <aj@suse.de>
1737         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
1738         REG_GS.
1739         (pthread_handle_sigrestart_rt): Likewise.
1740         * signals.c (pthread_sighandler_rt): Likewise.
1742 2000-03-02  Andreas Jaeger  <aj@suse.de>
1744         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
1745         Reported by Sean Chen <sean.chen@turbolinux.com>.
1747 2000-02-28  Andreas Jaeger  <aj@suse.de>
1749         * rwlock.c: Fix typo.
1751 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
1753         * rwlock.c: Define __* variants of the functions and make old names
1754         aliases.
1755         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
1756         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
1758 2000-02-25  Andreas Jaeger  <aj@suse.de>
1760         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1761         pwrite64, lseek64, open64, and __open64 with version 2.2.
1763 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
1765         * semaphore.h (SEM_FAILED): Use 0 not NULL.
1767 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
1769         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
1770         nanosleep does not work either.  Get absolute time inside the
1771         loop.
1772         (pthread_cond_timedwait_relative_new): Likewise.
1773         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1775 2000-02-13  Andreas Jaeger  <aj@suse.de>
1777         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
1778         (pthread_cond_timedwait_relative_old): Likewise.
1780 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
1782         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
1783         but keep the code around.  A bug in the kernel prevent us from
1784         using the code.
1785         (pthread_cond_timedwait_relative_new): Likewise.
1786         (PR libc/1597 and libc/1598).
1788 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
1790         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
1791         loop around nanosleep calls instead of around most of the function
1792         (pthread_cond_timedwait_relative_new): Likewise.
1793         body.  Got rid of backwards goto and one local.
1795 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
1797         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
1798         before every nanosleep call to account for time spent in the rest
1799         of the function.
1800         (pthread_cond_timedwait_relative_new): Likewise.
1801         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
1803 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
1805         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
1806         from nanosleep call so that in case we restart we only wait for the
1807         remaining time.
1808         (pthread_cond_timedwait_relative_new): Likewise.
1809         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
1811 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
1813         * manager.c (pthread_allocate_stack): Compute guard page address
1814         correctly.  Patch by HJ Lu.
1816         * sysdeps/pthread/pthread.h: Define
1817         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
1819 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
1821         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
1822         preference handling.
1823         (pthread_rwlockattr_setkind_np): Allow
1824         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
1825         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1827 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
1829         * internals.h (pthread_readlock_info): New structure.
1830         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
1831         p_untracked_readlock_count.
1832         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1833         Add initializers for new fields.
1834         * manager.c (pthread_free): Free read/write lock lists.
1835         * queue.h (queue_is_empty): New function.
1836         * rwlock.c: Implement requirements about when readers should get
1837         locks assigned.
1838         * sysdeps/pthread/pthread.h
1839         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
1840         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
1841         Define this name as well.
1842         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1844 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
1846         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1847         Adjust initializers for struct _pthread_descr_struct change.
1848         * internals.h (struct _pthread_descr_struct): Move new elements to
1849         the end.
1851 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
1853         Redesigned how cancellation unblocks a thread from internal
1854         cancellation points (sem_wait, pthread_join,
1855         pthread_cond_{wait,timedwait}).
1856         Cancellation won't eat a signal in any of these functions
1857         (*required* by POSIX and Single Unix Spec!).
1858         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
1859         simultaneous condition variable signal (not required by POSIX
1860         or Single Unix Spec, but nice).
1861         * spinlock.c: __pthread_lock queues back any received restarts
1862         that don't belong to it instead of assuming ownership of lock
1863         upon any restart; fastlock can no longer be acquired by two threads
1864         simultaneously.
1865         * restart.h: Restarts queue even on kernels that don't have
1866         queued real time signals (2.0, early 2.1), thanks to atomic counter,
1867         avoiding a rare race condition in pthread_cond_timedwait.
1869 1999-12-31  Andreas Jaeger  <aj@suse.de>
1871         * internals.h: Remove duplicate prototype declarations.
1873         * weaks.c: Remove __THROW from prototypes since the file is not
1874         compiled by a C++ compiler.
1875         * internals.h: Likewise.
1877 1999-12-30  Andreas Jaeger  <aj@suse.de>
1879         * sysdeps/pthread/pthread.h: Move internal functions to...
1880         * sysdeps/pthread/bits/libc-lock.h: ...here.
1882 1999-12-29  Andreas Jaeger  <aj@suse.de>
1884         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
1886 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
1888         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
1889         beginning.
1891         * manager.c (__pthread_start): Add one more cast to prevent
1892         warning on 64bit machines.
1894 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
1896         * manager.c (pthread_handle_create): Set p_pid of new thread
1897         before calling the callback function to report a new thread.
1899 1999-12-20  Andreas Jaeger  <aj@suse.de>
1901         * pthread.c (pthread_initialize): Move getrlimit call after
1902         setting of errno.
1904 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
1906         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1907         pwrite64, lseek64, open64, and __open64.
1908         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
1909         pwrite64, lseek64, open64, and __open64.
1911         * manager.c (pthread_allocate_stack): Correct computation of
1912         new_thread_bottom.  Correct handling of stack size and when the
1913         rlimit method to guard for stack growth is used.
1914         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
1915         minus one pagesize (not two).
1917 1999-12-03  Andreas Jaeger  <aj@suse.de>
1919         * Versions: Add __res_state with version GLIBC_2.2.
1921         * errno.c (__res_state): New function to return thread specific
1922         resolver state.
1924         * pthread.c (pthread_initialize): Initialize p_resp.
1925         (__pthread_reset_main_thread): Also set p_resp.
1927         * manager.c (pthread_handle_create): Initialize p_resp.
1929         * internals.h: Add thread specific resolver state.
1930         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
1932 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
1934         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
1935         beginning.
1936         * sysdeps/i386/i686/pt-machine.h: Likewise.
1937         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
1939 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
1941         * manager.c (pthread_start_thread_event): Initialize p_pid already
1942         here.
1944 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
1946         * internals.h: Add prototype for __pthread_manager_event.
1947         * manager.c (__pthread_manager_event): New function.
1948         (pthread_start_thread_event): Correct computation of self.
1949         Use INIT_THREAD_SELF.
1950         * pthread.c (__pthread_manager_thread): Initialize p_lock.
1951         (__pthread_initialize_manager): Respect event flags also for creation
1952         of the manager thread.
1954 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
1956         * pthread.c (__pthread_initialize_manager): Initialize
1957         __pthread_manager_thread.p_tid.
1959 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
1961         * internals.h: Declare __pthread_last_event.
1962         * manager.c: Define __pthread_last_event.
1963         (pthread_handle_create): Set __pthread_last_event.
1964         (pthread_exited): Likewise.
1965         * join.c (pthread_exit): Likewise.
1967         * Makefile (libpthread-routines): Add events.
1968         * events.c: New file.
1969         * internals.h: Protect against multiple inclusion.
1970         Include thread_dbP.h header.
1971         (struct _pthread_descr_struct): Add new fields p_report_events and
1972         p_eventbuf.
1973         Declare event reporting functions.
1974         * join.c (pthread_exit): Signal event if this is wanted.
1975         * manager.c (__pthread_threads_events): New variable.
1976         (pthread_handle_create): Take new parameters with event information.
1977         Signal TD_CREATE event if wanted.
1978         (__pthread_manager): Adjust pthread_handle_create call.
1979         (pthread_start_thread_event): New function.  Block until manager is
1980         finished and then call pthread_start_thread.
1981         (pthread_exited): Signal TD_REAP event if wanted.
1983 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
1985         * restart.h (suspend_with_cancellation): Rewrite as a macro.
1987         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
1989 1999-10-25  Andreas Jaeger  <aj@suse.de>
1991         * internals.h: Remove K&R compatibility.
1992         * no-tsd.c: Likewise.
1993         * semaphore.h: Likewise.
1994         * signals.c: Likewise.
1995         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
1996         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
1997         * weaks.c: Likewise.
1999 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
2001         * pthread.c: For i386, wrap pthread_handle_sigrestart and
2002         pthread_handle_sigcancel with functions that restore %gs from the
2003         signal context.  For each signal handling function, two wrappers
2004         are required, one for a non-RT signal and one for a RT signal.
2005         * signal.c: For i386, add code to restore %gs from the signal
2006         context in pthread_sighandler and pthread_sighandler_rt.
2008 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
2010         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
2012 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
2014         * pthread.c (__pthread_initial_thread): Pass argument to
2015         PTHREAD_START_ARGS_INITIALIZER.
2016         (__pthread_manager_thread): Likewise.
2018         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
2019         initialize function.
2021         * manager.c (pthread_handle_create): Remove p_startfct initialization.
2023         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
2025 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
2027         * internals.h: Correct return types for __libc_read and __libc_write.
2029 1999-10-09  Andreas Jaeger  <aj@suse.de>
2031         * internals.h: Add __new_sem_post to get prototype in
2032         manager.c; include semaphore.h for needed types.
2034 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
2036         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
2037         directly instead of calling sem_post which should not be necessary
2038         but is faster and might help in some case to work around problems.
2039         Patch by khendricks@ivey.uwo.ca [libc/1382].
2041 1999-10-08  Andreas Schwab  <schwab@suse.de>
2043         * sysdeps/pthread/Subdirs: New file.
2044         * Implies: Removed.
2046 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
2048         * Implies: New file.
2049         * internals.h (struct _pthread_descr_struct): Add p_startfct.
2050         * manager.c (pthread_handle_create): Initialize p_startfct.
2051         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
2053 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
2055         * manager.c (__linuxthreads_pthread_threads_max): New variable.
2056         * specific.c (__linuxthreads_pthread_keys_max): New variable.
2057         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
2059         * condvar.c (pthread_cond_timedwait_relative): Never return with
2060         EINTR.  Patch by Andreas Schwab.
2062 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
2064         * signals.c (sigaction): Correct last patch.  Don't select
2065         pthread_sighandler_rt based on the signal number but instead of
2066         the SA_SIGINFO flag.
2068 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
2070         * specific.c: Move definitions of struct pthread_key_struct and
2071         destr_function to ...
2072         * internals.h: ...here.
2074 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
2076         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
2077         this instead of pthread_handle_sigrestart if the signal is an RT
2078         signal.
2080         * signals.c: Handle passing through of sighandler arguments also
2081         for real-time signals.
2083 1999-09-03  Andreas Schwab  <schwab@suse.de>
2085         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
2086         fork as weak alias.
2087         (__vfork): New function, alias vfork.
2088         * Versions: Export __fork, vfork, and __vfork in libpthread.
2090 1999-08-23  Andreas Schwab  <schwab@suse.de>
2092         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
2093         call to signal handler.
2095 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
2097         * pthread.c (__pthread_reset_main_thread): Undo last change.
2098         (__pthread_kill_other_threads_np): Reset signal handlers for the
2099         signals we used in the thread implementation here.
2101 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
2103         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
2104         for the signals we used in the thread implementation [PR libc/1234].
2106         * Versions: Export __pthread_kill_other_threads_np from libpthread
2107         for GLIBC_2.1.2.
2109         * signals.c: Pass sigcontext through wrapper to the user function.
2111 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
2113         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
2114         __libc_internal_tsd_set.
2116 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2118         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
2119         needed anymore.
2121 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2123         * internals.h: Align _pthread_descr_struct to 32 bytes.
2124         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
2125         libc/1206.
2127 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
2129         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
2130         swap function.
2132 1999-07-09  Cristian Gafton  <gafton@redhat.com>
2134         * Makefile (libpthread-routines): Add oldsemaphore routine.
2135         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
2136         sem_trywait, and sem_wait to GLIBC_2.1.
2137         * oldsemaphore.c: New file.
2138         * semaphore.c: Add default_symbol_versions for the changed functions.
2139         (__new_sem_init): Rename from sem_init.
2140         (__new_sem_post): Rename from sem_post.
2141         (__new_sem_wait): Rename from sem_wait.
2142         (__new_sem_trywait): Rename from sem_trywait.
2143         (__new_sem_getvalue): Rename from sem_getvalue.
2144         (__new_sem_destroy): Rename from sem_destroy.
2146 1999-06-23  Robey Pointer  <robey@netscape.com>
2148         * internals.h: Added p_nextlock entry to separate queueing for a
2149         lock from queueing for a CV (sometimes a thread queues on a lock
2150         to serialize removing itself from a CV queue).
2151         * pthread.c: Added p_nextlock to initializers.
2152         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
2154 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
2156         * manager.c (pthread_handle_create): Free mmap region after stack
2157         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
2159 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2161         * man/pthread_cond_init.man: Correct example.
2162         Reported by Tomas Berndtsson <tomas@nocrew.org>.
2164         * linuxthreads.texi (Condition Variables): Likewise.
2166 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
2168         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
2169         casx not cas, also successful casx returns the old value in rd
2170         and not the new value.
2172 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
2174         * manager.c: If pthread_create() is given a NULL attribute
2175         and the thread manager runs with a realtime policy, set the
2176         scheduling policy of the newly created thread back to SCHED_OTHER.
2177         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
2178         initialize the schedpolicy field of new_thread->p_start_args
2179         to that of the calling thread.
2181 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
2183         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
2184         instruction does not allow memory element to use offset.
2186 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
2188         * manager.c (pthread_allocate_stack): Optimize initialization of new
2189         thread descriptor.
2191         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
2192         Don't use initializer since it is all zeroes.
2193         (__libc_once_define): Likewise.
2195 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2197         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
2198         doesn't exist anymore.
2199         * sysdeps/i386/Implies: Likewise.
2200         * sysdeps/m68k/Implies: Likewise.
2201         * sysdeps/mips/Implies: Likewise.
2202         * sysdeps/powerpc/Implies: Likewise.
2203         * sysdeps/sparc/sparc32/Implies: Likewise.
2204         * sysdeps/sparc/sparc64/Implies: Likewise.
2206 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
2208         * sysdeps/alpha/bits/semaphore.h: Removed.
2209         * sysdeps/powerpc/bits/semaphore.h: Removed.
2210         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
2211         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
2212         * Makefile (headers): Remove bits/semaphore.h.
2214         * semaphore.h: Define _pthread_descr if necessary.
2215         Don't include limits.h.  Define SEM_VALUE_MAX directly.
2216         Define SEM_FAILED.
2217         (sem_t): Protect element names with leading __.
2218         Add declarations for sem_close, sem_open, and sem_unlink.
2219         * semaphore.c: Adjust all functions for new element names.
2220         Define sem_close, sem_open, and sem_unlink.
2221         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
2222         GLIBC_2.1.1.
2223         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
2224         necessary.
2226 1999-03-16  H.J. Lu  <hjl@gnu.org>
2228         * specific.c (pthread_key_delete): Check th->p_terminated to see
2229         if the thread is running.
2231         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
2232         Added to GLIBC_2.0 for libc.so.
2234 1999-02-12  H.J. Lu  <hjl@gnu.org>
2236         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
2237         __libc_allocate_rtsig): Added to GLIBC_2.1.
2239         * internals.h (DEFAULT_SIG_RESTART): Removed.
2240         (DEFAULT_SIG_CANCEL): Removed.
2242         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
2243         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
2244         (__pthread_sig_restart, __pthread_sig_cancel,
2245         __pthread_sig_debug): Initialized.
2246         (pthread_initialize): Call init_rtsigs () to initialize
2247         real-time signals.
2249 1999-02-03  H.J. Lu  <hjl@gnu.org>
2251         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
2252         Don't restart the thread which sent REQ_DEBUG.
2253         (pthread_start_thread): Check if __pthread_sig_debug > 0
2254         before debugging.
2256         * pthread.c (__pthread_initialize_manager): Suspend ourself
2257         after sending __pthread_sig_debug to gdb instead of
2258         __pthread_sig_cancel.
2260 1999-01-24  H.J. Lu  <hjl@gnu.org>
2262         * manager.c (__pthread_manager): Delete __pthread_sig_debug
2263         from mask if __pthread_sig_debug > 0.
2264         (pthread_handle_create): Increment __pthread_handles_num.
2266         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
2267         * pthread.c (__pthread_initialize_manager): Likewise.
2269         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
2270         instead of __libc_allocate_rtsig (2).
2271         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
2272         instead of __pthread_sig_cancel.
2273         (pthread_handle_sigdebug): Fix comments.
2275 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
2277         * manager.c (pthread_allocate_stack): Set
2278         __pthread_nonstandard_stacks if user-specified stack is used.
2280 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
2282         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
2283         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
2285 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
2287         * pthread.c: Use a third signal __pthread_sig_debug distinct
2288         from __pthread_sig_cancel to notify gdb when a thread is
2289         created
2290         * manager.c: Likewise.
2291         * internals.h: Likewise.
2292         * signals.c: The implementation of sigwait(s) assumed that
2293         all signals in s have signal handlers already attached.
2294         This is not required by the standard, so make it work
2295         also if some of the signals have no handlers.
2297 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
2299         * linuxthreads.texi: Remove pointers from first @node.  Move old
2300         @node spec inside comment.
2302 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
2304         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
2305         _IO_lock_unlock.
2307 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
2309         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
2310         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
2312 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
2314         * manager.c: Threads now send __pthread_sig_cancel on termination.
2315         Change clone call and signal masks.
2316         * thread.c (pthread_handle_sigrestart): Remove special code for
2317         manager.
2318         (pthread_handle_sigcancel): In manager thread call
2319         __pthread_manager_sighandler.
2320         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
2321         * sysdeps/i386/i686/pt-machine.h: Likewise.
2322         Patches by Xavier Leroy.
2324 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
2326         * spinlock.c (__pthread_unlock): Don't crash if called for an
2327         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
2329         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
2330         overall runtime.
2332 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
2334         * Examples/ex3.c: Wait until all threads are started before
2335         searching for the number to avoid race condition on very fast
2336         systems.
2338 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2340         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
2341         declaration since it's not needed.
2343         * sysdeps/pthread/pthread.h: Move internal functions to ...
2344         * internals.h: ...here.
2346 1998-12-02  H.J. Lu  <hjl@gnu.org>
2348         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
2349         SIGRTMIN is defined.
2350         (__pthread_sig_cancel): Likewise.
2352 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2354         * wrapsyscall.c: Include <sys/mman.h> for msync,
2355         <stdlib.h> for system and <termios.h> for tcdrain prototype.
2356         Correct msync declaration.
2358 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
2360         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
2361         __libc_tsd_set): New macros for new interface.
2362         * no-tsd.c: New file, provide uninitialized defns of
2363         __libc_internal_tsd_get and __libc_internal_tsd_set.
2364         * Makefile (routines): Add no-tsd.
2366 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
2368         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
2369         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2370         __libc_internal_tsd_set): Move decls to ...
2371         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
2372         declarations.
2374         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2375         __libc_internal_tsd_set): Make these pointers to functions, not
2376         functions; remove #pragma weak decls for them.
2377         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
2378         Define static functions and initialized pointers to them.
2380 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
2382         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
2383         (CFLAGS-specific.c): Likewise.
2384         (CFLAGS-pthread.c): Likewise.
2385         (CFLAGS-ptfork.c): Likewise.
2386         (CFLAGS-cancel.c): Likewise.
2387         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
2388         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
2390         * mutex.c (pthread_mutex_init): Define as strong symbol.
2391         (pthread_mutex_destroy): Likewise.
2392         (pthread_mutex_trylock): Likewise.
2393         (pthread_mutex_lock): Likewise.
2394         (pthread_mutex_unlock): Likewise.
2395         (pthread_mutexattr_init): Likewise.
2396         (pthread_mutexattr_destroy): Likewise.
2397         (pthread_once): Likewise.
2398         * ptfork.c (pthread_atfork): Likewise.
2399         * specific.c (pthread_key_create): Likewise.
2400         (pthread_setspecific): Likewise.
2401         (pthread_getspecific): Likewise.
2403 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
2405         * linuxthreads.texi: Fix punctuation after xref.
2407 1998-11-10  H.J. Lu  <hjl@gnu.org>
2409         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
2410         if it is defined in <linux/limits.h>.
2412 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
2414         * spinlock.h (__pthread_trylock): Define inline.
2415         (__pthread_lock): Add extra parameter to declaration.  Declare
2416         using internal_function.
2417         (__pthread_unlock): Declare using internal_function.
2418         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
2419         of local variable self.  Avoid recomputing self.  Define using
2420         internal_function.
2421         (__pthread_trylock): Remove.
2422         (__pthread_unlock): Define using internal_function.
2423         * cancel.c: Adjust for __pthread_lock interface change.  Use already
2424         computed self value is possible.
2425         * condvar.c: Likewise.
2426         * join.c: Likewise.
2427         * manager.c: Likewise.
2428         * mutex.c: Likewise.
2429         * pthread.c: Likewise.
2430         * rwlock.c: Likewise.
2431         * semaphore.c: Likewise.
2432         * signals.c: Likewise.
2434 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
2436         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
2437         __ to field names of the struct.
2438         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
2439         Likewise.
2440         (pthread_attr_t): Likewise.
2441         (pthread_cond_t): Likewise.
2442         (pthread_condattr_t): Likewise.
2443         (pthread_mutex_t): Likewise.
2444         (pthread_mutexattr_t): Likewise.
2445         (pthread_rwlock_t): Likewise.
2446         (pthread_rwlockattr_t): Likewise.
2447         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
2448         * cancel.c: Likewise.
2449         * condvar.c: Likewise.
2450         * manager.c: Likewise.
2451         * mutex.c: Likewise.
2452         * pthread.c: Likewise.
2453         * ptlongjmp.c: Likewise.
2454         * rwlock.c: Likewise.
2455         * spinlock.c: Likewise.
2457 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
2459         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
2460         also with PT_EI.
2462         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
2463         definitions.
2465         * Makefile (libpthread-routines): Add pt-machine.
2466         * pt-machine.c: New file.
2467         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
2468         yet defined.  Use PT_EI in extern inline definitions.
2469         * sysdeps/arm/pt-machine.h: Likewise.
2470         * sysdeps/i386/pt-machine.h: Likewise.
2471         * sysdeps/i386/i686/pt-machine.h: Likewise.
2472         * sysdeps/m68k/pt-machine.h: Likewise.
2473         * sysdeps/mips/pt-machine.h: Likewise.
2474         * sysdeps/powerpc/pt-machine.h: Likewise.
2475         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
2476         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2478 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2480         * semaphore.h: Include <sys/types.h> so that _pthread_descr
2481         is declared.
2483 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
2485         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
2486         argument.
2487         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
2489 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
2491         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
2492         guard.
2494 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2496         * signals.c (sigaction): Check that sig is less than NSIG to avoid
2497         array index overflow.
2499 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
2501         * sysdeps/pthread/semaphore.h: New file.
2503 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
2505         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
2506         _LIBC_TSD_KEY_DL_ERROR.
2508 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
2510         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
2511         * sysdeps/i386/pt-machine.h: Likewise.
2512         Suggested by Roland McGrath.
2514 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
2516         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
2517         access thread data with non-constant offsets.
2518         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
2519         necessary.
2521         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
2522         THREAD_SETMEM_NC definitions.
2524         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
2525         THREAD_SETMEM_NC.
2526         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2528 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
2530         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
2531         not already defined.
2532         (struct _pthread_descr_struct): Add p_self and p_nr field.
2533         * manager.c (__pthread_handles): Define second element to point
2534         to manager thread.
2535         (__pthread_handles_num): Initialize to 2.
2536         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
2537         (pthread_start_thread): Likewise.
2538         (pthread_handle_create): Start search for free slot at entry 2.
2539         Initialize new fields p_self and p_nr.
2540         Call __clone with CLONE_PTRACE if available.
2541         (pthread_free): Call FREE_THREAD_SELF if available.
2542         * pthread.c (__pthread_initial_thread): Initialize new fields.
2543         (__pthread_manager_thread): Likewise.
2544         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
2546         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
2547         elements of the thread descriptor.
2548         * condvar.c: Likewise.
2549         * errno.c: Likewise.
2550         * join.c: Likewise.
2551         * manager.c: Likewise.
2552         * pthread.c: Likewise.
2553         * ptlongjmp.c: Likewise.
2554         * semaphore.c: Likewise.
2555         * signals.c: Likewise.
2556         * specific.c: Likewise.
2557         * spinlock.c: Likewise.
2559         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
2561         * sysdeps/i386/useldt.h: New file.
2562         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
2564         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
2565         THREAD_SETMEM using __thread_self.
2566         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2568 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
2570         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
2571         turned out that we didn't need to queue after all.
2573 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
2575         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
2576         and wastes space; correct types.
2578 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
2580         * signals.c (sigaction): Handle NULL argument.
2582 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
2584         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
2585         of sigset_t.
2587 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2589         * Makefile (linuxthreads-version): Extract correct number from
2590         Banner.
2592 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
2594         * Banner: Bump version number to 0.8
2595         * FAQ.html: Many updates, in particular w.r.t. debugging.
2596         * manager.c: Support for non-default stacksize for
2597         LinuxThreads-allocated stacks;
2598         don't use guard pages for stacks with default size, rely on
2599         rlimit(RLIMIT_STACK) instead (it's cheaper).
2600         * attr.c: Likewise.
2601         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
2602         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
2603         * condvar.c: Likewise.
2604         * internals.h: Likewise.
2605         * restart.h: Likewise.
2606         * signals.c: Likewise.
2607         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
2609 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2611         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
2612         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
2613         * Versions: Put __pthread_mutexattr_settype under version
2614         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
2615         __pthread_mutexattr_gettype.
2617 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2619         * sysdeps/pthread/bits/libc-lock.h: Make
2620         __pthread_mutexattr_settype weak.  Don't make
2621         __pthread_mutexattr_setkind_np weak.
2623 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
2625         * manager.c (pthread_handle_create): Check whether sched_setscheduler
2626         call can succeed here.
2628         * mutex.c: Define __pthread_mutexattr_settype and make
2629         __pthread_mutexattr_setkind_np an alias.
2630         Likewise for __pthread_mutexattr_gettype.
2632 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
2634         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
2635         is root.
2637 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
2639         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
2641 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2643         * Examples/ex6.c: Include <unistd.h> for usleep.
2645 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2647         * Examples/ex4.c (main): Use exit, not pthread_exit.
2649 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
2651         * Versions: Add __pthread_mutexattr_gettype and
2652         __pthread_mutexattr_settype.
2653         * lockfile.c: Use __pthread_mutexattr_settype instead of
2654         __pthread_mutexattr_setkind_np.
2655         * mutex.c: Define __pthread_mutexattr_gettype and
2656         __pthread_mutexattr_settype.
2657         * weak.c: Likewise.
2658         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
2659         __pthread_mutexattr_settype.
2660         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
2661         Use __pthread_mutexattr_settype.
2663 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
2665         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
2666         * mutex.c: Define weak alias pthread_mutexattr_gettype and
2667         pthread_mutexattr_settype.
2668         * sysdeps/pthread/pthread.h: Declare these functions.
2669         Move pthread_sigmask and pthread_kill declaration in separate header.
2670         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
2672 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
2674         * Makefile: Add rules to compile and run tests.
2675         * Examples/ex1.c: Little changes to fix warnings.
2676         * Examples/ex2.c: Likewise.
2677         * Examples/ex3.c: Likewise.
2678         * Examples/ex4.c: Likewise.
2679         * Examples/ex5.c: Likewise.
2680         * Examples/ex6.c: New file.
2682 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
2684         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
2686 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2688         * attr.c: Include <string.h>.
2690 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
2692         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
2693         * internals.h: Include limits.h.
2694         * manager.c: Use memcpy to copy sched_param.
2695         * ptfork.c: Include errno.h.
2696         * pthread.c: Likewise.
2697         * semaphore.c: Likewise.
2698         * specific.c: Likewise.
2699         * spinlock.h: Likewise.
2700         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
2701         type definition to ...
2702         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
2704 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
2706         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
2708         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
2709         as macros as demanded in POSIX.1, Annex C.
2711 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
2713         * internals.h (struct pthread_request): For free use pthread_t
2714         instead of pthread_descr.
2715         * join.c (pthread_join): Pass thread_id, not th to manager.
2716         (pthread_detach): Likewise.
2717         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
2718         (pthread_exited): Remove detached queue code.
2719         (pthread_handle_free): Expect thread ID parameter and use it to
2720         validate the thread decsriptor.  Don't use detached queue.
2721         Patches by Xavier Leroy.
2723 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2725         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
2726         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
2727         __pthread_atfork, __pthread_key_create, __pthread_once.
2728         * internals.h: Doc fix.
2729         * pthread.c (__pthread_initialize): Define again.
2731 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
2733         * manager.c (pthread_exited): If thread is not detached put it on
2734         special list.
2735         (pthread_handle_free): If thread is not on list with living threads
2736         search on list with detached threads.
2738         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
2739         for new definition of pthread_rwlock_t.
2741         * spinlock.c: Correct test whether to compile
2742         __pthread_compare_and_swap or not.
2744 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
2746         * attr.c: Finish user stack support.  Change locking code to be safe
2747         in situations with different priorities.
2748         * cancel.c: Likewise.
2749         * condvar.c: Likewise.
2750         * internals.h: Likewise.
2751         * join.c: Likewise.
2752         * manager.c: Likewise.
2753         * mutex.c: Likewise.
2754         * pthread.c: Likewise.
2755         * ptlongjmp.c: Likewise.
2756         * queue.h: Likewise.
2757         * rwlock.c: Likewise.
2758         * semaphore.c: Likewise.
2759         * semaphore.h: Likewise.
2760         * signals.c: Likewise.
2761         * spinlock.c: Likewise.
2762         * spinlock.h: Likewise.
2763         * sysdeps/pthread/pthread.h: Likewise.
2764         Patches by Xavier Leroy.
2766         * sysdeps/i386/i686/pt-machine.h: New file.
2768 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
2770         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
2771         [sg]et_stackaddr prototypes always available.
2773         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2774         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
2776 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
2778         * manager.c (pthread_free): Undo patch from 980430.
2779         Reported by David Wragg <dpw@doc.ic.ac.uk>.
2781 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
2783         * manager.c: Define __pthread_manager_adjust_prio and use it to
2784         increase priority when needed.
2785         * internals.h: Add prototype for __pthread_manager_adjust_prio.
2786         * mutex.c: Optimize mutexes to wake up only one thread.
2787         * pthread.c: Move PID of manager for global variable in structure
2788         element.
2789         Patches by Xavier Leroy.
2791 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
2793         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
2795 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2797         * attr.c: Correct typo.
2799 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
2801         * manager.c (pthread_free): Unmap guard before the stack.
2802         Patch by Matthias Urlichs.
2804 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
2806         * manager.c (pthread_free): Detect already free child.
2807         Patch by Xavier Leroy, reported by Matthias Urlichs.
2809 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2811         * Makefile (linuxthreads-version): Renamed back from
2812         libpthread-version.
2814 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
2816         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
2817         __libc_longjmp.
2819 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
2821         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
2822         * internals.h: Add definitions for new spinlock implementation.
2823         * ptlongjmp.c: New file.
2824         * spinlock.c: New file.
2825         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
2826         new function __pthread_acquire to prevent deadlocks with thread
2827         with different priorities.
2828         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
2830 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2832         * manager.c (__pthread_manager): Reduce first argument to select
2833         to include just the needed file descriptor.
2835 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
2837         * manager.c: Fix last patch which caused core dumps.
2839         * pthread.c: Correctly handle missing SIGRTMIN.
2841 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2843         * libpthread.map: Add __libc_internal_tsd_get and
2844         __libc_internal_tsd_set.  Add missing cancelable functions. Export
2845         libc internal versions of the cancelable functions.
2847 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
2849         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
2851 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
2853         * attr.c: Implement pthread_attr_[gs]etguardsize,
2854         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
2855         Change pthread_attr_init to have two interfaces.
2856         * internals.h (struct _pthread_descr_struct): Add new fields for
2857         above functions.
2858         * libpthread.map: Add names in GLIBC_2.1 section.
2859         * manager.c (pthread_handle_create): Implement guardsize and
2860         user stack.
2861         (pthread_free): Likewise.
2862         * pthread.c (pthread_create): Add new interface for changed
2863         pthread_attr_t.
2864         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2865         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
2866         PTHREAD_STACK_MIN.
2868 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
2870         * manager.c: Enable resetting of the thread scheduling policy
2871         to SCHED_OTHER when the parent thread has a different one.
2873 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
2875         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2876         _POSIX_ASYNCHRONOUS_IO.
2878         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
2879         mutexes.
2880         * mutex.c: Implement new mutex types.
2882         * internals.h: Include <signal.h>.
2884         * libpthread.map: Add __erno_location and __h_errno_location.
2886         * errno.c: Return pointer to variable actually in use.  This might
2887         not be the one in the thread structure.
2888         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
2889         and p_h_errnop.
2890         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
2891         of manager thread structure.
2892         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
2893         thread.
2894         * pthread.c: Adapt initializer for thread structures.
2895         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
2896         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
2897         current thread to global variables.
2899 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
2901         * rwlock.c: New file.
2902         * Makefile (libpthread-routines): Add rwlock.
2903         * sysdeps/pthread/pthread.h: Define data structures and declare
2904         functions.
2905         * libpthread.map: Add new functions.
2907 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
2909         * sysdeps/arm/pt-machine.h: New file; add ARM support.
2910         * sysdeps/arm/Implies: likewise.
2911         * README: Document it.
2913 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2915         * signals.c: Remove unneeded initializer for sigwaited, saving a
2916         warning.
2918 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2920         * semaphore.c (sem_init): Set sem_spinlock only if available.
2922 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
2924         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
2925         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
2927         * Makefile: Update from LinuxThreads 0.7.
2928         * internals.h. Likewise.
2929         * manager.c: Likewise.
2930         * mutex.c: Likewise.
2931         * pthread.c: Likewise.
2932         * signals.c: Likewise.
2933         * specific.c: Likewise.
2934         * Examples/ex3.c: Likewise.
2936 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
2938         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
2939         open.
2941 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
2943         * wrapsyscall.c: Add socket functions which are also cancelation
2944         points.
2946 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
2948         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
2949         New functions for fast thread specific data within libc.
2951         * internals.h: Add new array p_libc_specific to struct
2952         _pthread_descr_struct.
2954         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
2956 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
2958         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
2959         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
2961 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
2963         * internals.h (struct _pthread_descr_struct): Add definitions for
2964         two-level specific key handling.
2965         * manager.c (pthread_handle_create): Initialize specific memory array.
2966         * specific.c: Implement two-level key handling.
2967         * weaks.c: Don't provide dummy key handling.
2968         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
2969         Add definition of __libc_key_t.
2970         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
2971         as 1024.
2972         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
2973         PTHREAD_DESTRUCTOR_ITERATIONS.
2975         * manager.c (pthread_handle_create): Compare mmap result with
2976         MAP_FAILED.
2978         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
2979         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
2981 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
2983         sysdeps/sparc -> sysdeps/sparc/sparc32
2984         sysdeps/sparc64 -> sysdeps/sparc/sparc64
2986         * internals.h: Change definition of THREAD_SELF to be an expression,
2987         not a statement that did a return.
2988         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
2989         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
2990         Follow Solaris and use a "system reserved" register (%g6) to hold
2991         the thread descriptor.
2992         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2994 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
2996         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
2997         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
2998         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
3000         * semaphore.c: Include spinlock.h only when needed.
3002         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
3003         keys for entries not in use.
3005         * weaks.c: Implement key handling functions for real.
3007 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
3009         Initial sparc64-linux support:
3010         * sysdeps/sparc64/Implies: New file.
3011         * sysdeps/sparc64/pt-machine.h: Likewise.
3013 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
3015         * semaphore.c: Include spinlock.h at correct place.
3016         Patch by HJ Lu.
3018 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
3020         The Great Bit File Move:
3021         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
3022         * sysdeps/powerpc/semaphorebits.h: Likewise.
3023         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
3024         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
3025         * sysdeps/pthread/libc-lock.h: -> bits/
3026         * sysdeps/pthread/stdio-lock.h: Likewise.
3027         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
3028         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
3029         * semaphore.h: Likewise.
3030         * sysdeps/pthread/pthread.h: Likewise.
3032         * lockfile.c: <foo.h> -> <bits/foo.h>.
3033         * semaphore.h: Likewise.
3035         * Makefile: (headers): foo.h -> bits/foo.h.
3036         * sysdeps/pthread/Makefile: Likewise.
3038 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
3040         * semaphore.c (sem_init): Set sem_spinlock only if available.
3042         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
3043         asm constraints.
3045 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
3047         Update from LinuxThreads 0.6.
3049         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
3050         and __sched_get_priority_min instead of names without `__'.
3052         * manager.c: Rewrite large parts to implement opaque pthread_t.
3054         * cancel.c: Adapt for opaque pthread_t type.
3055         * condvar.c: Likewise.
3056         * errno.c: Likewise.
3057         * join.c: Likewise.
3058         * mutex.c: Likewise.
3059         * pthread.c: Likewise.
3060         * signals.c: Likewise.
3061         * specific.c: Likewise.
3062         * restart.h: Likewise.
3063         * queue.h: Likewise.
3064         * Examples/ex3.c: Likewise.
3065         * Examples/ex4.c: Likewise.
3066         * sysdeps/pthread/pthread.h: Likewise.
3068         * pthread.c: Accumulate time for all threads in thread manager.
3070         * semaphore.c: Implement fallback implementation for architectures
3071         sometimes missing compare-exchange operations.
3073         * cancel.c (pthread_cancel): Validate handle argument.
3074         * join.c (pthread_join): Likewise.
3075         (pthread_detach): Likewise.
3076         * signals.c (pthread_kill): Likewise.
3078         * spinlock.h (acquire): Use __sched_yield not sched_yield.
3080         * queue.h (enqueue): Enqueue thread according to priority.
3082         * internals.c (struct pthread_start_args): New struct for passing
3083         args to cloning function.
3084         (struct _pthread): Rename to _pthread_descr_struct and adapt for
3085         opaque pthread_t.
3087         * Examples/Makefile (clean): Pass -f option to rm.
3089         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
3090         and define TEST_FOR_COMPARE_AND_SWAP.
3091         * sysdeps/i386/i486/pt-machine.h: Removed.
3093         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
3094         to 1024.
3096 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
3098         * restart.h (suspend): Clear p_signal before suspending.
3099         (suspend_with_cancellation): Likewise.
3100         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
3102         * weaks.c: Make __pthread_key_create return 1.
3103         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
3104         __libc_getspecific, __libc_setspecific, and __libc_key_t.
3105         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
3106         using libio.
3108 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
3110         * sysdeps/sparc/pt-machine (RELEASE): Fix.
3112 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
3114         * sysdeps/powerpc/Implies: Added.
3115         * sysdeps/powerpc/pt-machine.h: Added.
3116         * sysdeps/powerpc/semaphorebits.h: Added.
3118 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
3120         * pthread.c (__pthread_initial_thread): Correct
3121         initializer.
3122         (__pthread_manager_thread): Likewise.
3123         Reported by Andreas Jaeger.
3125 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
3127         Since sigset_t no longer fits in a register, we can't pass in the
3128         thread's initial mask so easily.  Take this opportunity to simplify
3129         the clone implementation by only accepting a single void* argument.
3131         * manager.c (__pthread_manager): Put thread vitals in the thread
3132         struct instead of as arguments through clone.
3133         (pthread_start_thread): Look for them there.
3134         * internals.h (struct _pthread): Add p_initial_fn,
3135         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
3136         * pthread.c (pthread_initialize_manager): Revise clone invocation.