1 2000-12-27 Ulrich Drepper <drepper@redhat.com>
3 * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr
4 element. Add warnings for using pthread_attr_getstackaddr and
5 pthread_attr_setstackaddr.
7 2000-12-26 Ulrich Drepper <drepper@redhat.com>
9 * Examples/ex6.c (test_thread): Make static.
10 * Examples/ex12.c (test_thread): Make static and add noreturn
13 2000-12-18 Jes Sorensen <jes@linuxcare.com>
15 * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
16 and compare_and_swap_with_release_semantics returns int not long.
18 2000-12-17 Andreas Jaeger <aj@suse.de>
20 * sysdeps/s390/pt-machine.h (testandset): Use long int as return
22 * sysdeps/arm/pt-machine.h (testandset): Likewise.
23 * sysdeps/hppa/pt-machine.h (testandset): Likewise.
24 * sysdeps/m68k/pt-machine.h (testandset): Likewise.
25 * sysdeps/sh/pt-machine.h (testandset): Likewise.
26 * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
27 * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
29 2000-12-17 Ulrich Drepper <drepper@redhat.com>
31 * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
32 * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
34 2000-12-17 Andreas Jaeger <aj@suse.de>
36 * internals.h: Add prototypes for testandset and
37 __compare_and_swap to shut up gcc warnings.
39 2000-12-06 Wolfram Gloger <wg@malloc.de>
41 * join.c (pthread_detach): Allow case where the thread has already
44 2000-12-05 Andreas Jaeger <aj@suse.de>
46 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
47 * sysdeps/mips/pt-machine.h (testandset): Likewise.
48 (__compare_and_swap): Likewise.
49 Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
51 2000-11-20 Jakub Jelinek <jakub@redhat.com>
53 * Examples/ex3.c (main): Cast int to long before casting to void *.
54 (search): Cast void * to long, not int.
55 * Examples/ex8.c (main, thread): Similarly.
56 * Examples/ex11.c (main): Similarly.
57 * Examples/ex14.c (worker, do_test): Similarly.
58 * ecmutex.c (worker, do_test): Similarly.
59 (nlocks): Cast to int.
61 2000-11-08 Bruce Mitchener <bruce@cubik.org>
63 * linuxthreads.texi: Add documentation for pthreads attributes
64 guardsize, stackaddr, stacksize, and stack. Fix typo in previous
65 patch. Document pthread_[sg]etconcurrency(). Mark
66 pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
68 2000-11-07 Ulrich Drepper <drepper@redhat.com>
70 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
72 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
73 Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
75 2000-11-06 Ulrich Drepper <drepper@redhat.com>
77 * cancel.c (pthread_cancel): Always set p_canceled, even if we are
78 not doing it right now.
79 Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
81 2000-10-30 Ulrich Drepper <drepper@redhat.com>
83 * Examples/ex4.c (main): Don't use exit() to avoid warning with
86 2000-10-29 Ulrich Drepper <drepper@redhat.com>
88 * attr.c (__pthread_attr_setguardsize): Don't round guardsize
89 here. Reported by Bruce Mitchener <bruce@cubik.org>.
91 * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
92 discussing mutexes. (As per the Unix98 name for the API.)
93 Changes documentation for pthread_mutexattr_setkind_np() and
94 pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
95 same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
96 Changes references to PTHREAD_MUTEXATTR_FAST_NP to
97 PTHREAD_MUTEXATTR_ADAPTIVE_NP.
98 Begins to introduce discussion of the ``timed'' mutex type. This
99 discussion is currently incomplete.
100 Patch by Bruce Mitchener <bruce@cubik.org>.
102 2000-10-26 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
103 Yutaka Niibe <gniibe@chroot.org>
105 * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
106 has restrictions, use register.
108 2000-10-23 Andreas Schwab <schwab@suse.de>
110 * Examples/ex14.c (TIMEOUT): Override default timeout.
112 2000-10-16 Ulrich Drepper <drepper@redhat.com>
114 * specific.c: Protect tsd array modification in thread data
115 structures by getting the thread lock in pthread_key_delete and
116 __pthread_destroy_specifics.
117 Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
119 2000-10-12 Alan Modra <alan@linuxcare.com.au>
121 * sysdeps/pthread/bits/initspin.h: New file.
122 * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
123 (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
124 (__pthread_alt_init_lock): Likewise.
125 (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
127 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
129 * oldsemaphore.c (__old_sem_init): Release lock with
130 LT_SPINLOCK_INIT, not zero.
131 * spinlock.c (__pthread_unlock): Likewise.
132 (__pthread_alt_lock): Likewise.
133 (__pthread_alt_timedlock): Likewise.
134 (__pthread_alt_unlock): Likewise.
135 * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
136 LT_SPINLOCK_INIT if it is non-zero. Likewise for init-once flags.
137 * sysdeps/pthread/pthread.h: Include bits/initspin.h. Use
138 LT_SPINLOCK_INIT do initialize spinlocks not 0.
140 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
142 * shlib-versions: Add version definitions for hppa-linux.
144 2000-10-12 Alan Modra <alan@linuxcare.com.au>
146 * sysdeps/hppa/pspinlock.c: New file.
147 * sysdeps/hppa/pt-machine.h: New file.
148 * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
150 2000-10-05 Jakub Jelinek <jakub@redhat.com>
152 * mutex.c (__pthread_mutex_destroy): Correct test of
153 busy mutex for mutexes using alternate fastlocks.
154 Patch by dtc@cmucl.cons.org.
156 2000-09-28 Martin Schwidefsksy <schwidefsky@de.ibm.com>
158 * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
160 2000-09-28 Ulrich Drepper <drepper@redhat.com>
162 * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
163 test for owner first.
164 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
166 * cancel.c (pthread_cancel): Don't do anything if cancelation is
169 2000-09-26 Ulrich Drepper <drepper@redhat.com>
171 * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
172 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
174 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
175 _POSIX_MONOTONIC_CLOCK.
177 * spinlock.h (__pthread_set_own_extricate_if): Add back locking
180 2000-09-20 Andreas Jaeger <aj@suse.de>
182 * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
183 "testrtsig.h" conditional.
185 2000-09-11 Ulrich Drepper <drepper@redhat.com>
187 * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
188 pthread_attr_setstack.
189 * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
190 pthread_attr_setstack.
191 * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
193 2000-09-05 Ulrich Drepper <drepper@redhat.com>
195 * Examples/ex14.c: New file.
196 * Makefile (tests): Add ex14.
198 * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
199 mutex. Patch by dtc@cmucl.cons.org.
201 * ecmutex.c: New file.
202 * Makefile (tests): Add ecmutex.
204 2000-09-04 H.J. Lu <hjl@gnu.org>
206 * attr.c (__pthread_attr_setguardsize): Use page_roundup
207 instead of roundup to round up to the page size.
209 2000-09-03 Mark Kettenis <kettenis@gnu.org>
211 * manager.c (pthread_exited): Correctly report event as TD_REAP
212 instead of TD_DEATH. Fix comments.
214 2000-09-03 Ulrich Drepper <drepper@redhat.com>
216 * spinlock.h (testandset): Add cast to avoid warning.
217 Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
219 2000-09-02 Andreas Jaeger <aj@suse.de>
221 * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
224 2000-09-01 Ulrich Drepper <drepper@redhat.com>
226 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
227 Fix typo in last patch (_mode -> _flags).
229 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
230 Provide definition which respects _IO_USER_LOCK flag.
232 2000-08-30 Ulrich Drepper <drepper@redhat.com>
234 * manager.c (pthread_allocate_stack): Clear descriptor only if not
237 2000-08-25 Ulrich Drepper <drepper@redhat.com>
239 * Makefile: Add rules to build and run unload.
240 * unload.c: New file.
242 * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
244 * sysdeps/pthread/pthread.h
245 (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
246 (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
248 2000-08-24 Andreas Jaeger <aj@suse.de>
250 * Examples/ex13.c: Include <string.h> for strerror prototype and
251 <stdlib.h> for abort prototype.
252 (pthr_cond_signal_mutex): Rewrite to silence GCC.
253 (thread_start): Remove unused variable err.
254 (main): Silence GCC warnings.
256 2000-08-22 Andreas Jaeger <aj@suse.de>
258 * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
260 * Makefile (tests): Add ex13.
262 2000-08-20 Ulrich Drepper <drepper@redhat.com>
264 * semaphore.h: Add restrict where required by AGd4.
265 * sysdeps/pthread/pthread.h: Likewise.
266 * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
268 2000-08-15 Ulrich Drepper <drepper@redhat.com>
270 * Makefile (tests): Add ex12. Add rule to build it.
271 * Examples/ex12.c: New file.
273 2000-08-13 Ulrich Drepper <drepper@redhat.com>
275 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
276 even though the implementation is not quite complete (but it reports
277 it). Define _POSIX_MESSAGE_PASSING to -1.
278 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
280 2000-08-12 Andreas Jaeger <aj@suse.de>
282 * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
284 (__compare_and_swap): Likewise.
285 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
287 2000-08-10 Ulrich Drepper <drepper@redhat.com>
289 * pthread.c (__pthread_initial_thread): Initialize p_errnop and
290 p_h_errnop correctly and not to NULL.
292 2000-08-05 Ulrich Drepper <drepper@redhat.com>
294 * Banner: Bump version number to 0.9.
296 2000-08-04 Ulrich Drepper <drepper@redhat.com>
298 * Makefile (tests): Add tststack. Add rule to build the program.
299 * tststack.c: New file.
301 * internals.h: Declare __pthread_max_stacksize.
302 * pthread.c (__pthread_max_stacksize): New variable.
303 (__pthread_initialize_manager): Determine __pthread_initialize_manager
305 * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
306 (pthread_allocate_stack): Allow kernel to choose stack address if
307 FLOATING_STACKS. This also handles variable-sized stacks.
308 Always allocate stack and guardpage together. Use mprotect to
309 change guardpage access.
310 * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
313 * attr.c (__pthread_attr_setstacksize): Also test value against
316 * manager.c (__pthread_nonstandard_stacks): Define only if
317 THREAD_SELF is not defined.
318 (pthread_allocate_stack): Always initialize gardaddr to a correct
320 (pthread_handle_create): Unmap thread with one call.
321 (pthread_free): Remove test for initial thread before removing stack.
322 Unmap stack with one call.
324 * pthread.c (__pthread_initial_thread): Initialize p_userstack to
325 1 to avoid removing the stack.
327 2000-07-27 Jes Sorensen <jes@linuxcare.com>
329 * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
330 load of spin lock to prime the cache before the atomic compare and
331 exchange operation (cmpxchg4). This avoids the spinning on the
332 cmpxchg4 instruction and reduces movement of the cache line back
333 and forth between the processors (explanation by Asis K. Mallick
334 from Intel). This basically makes the implementation operate the
335 same as the Linux kernel implementation.
337 * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
338 * sysdeps/ia64/pspinlock.c: New file.
340 2000-08-03 Ulrich Drepper <drepper@redhat.com>
342 * pthread.c: Move definition of __pthread_set_own_extricate_if...
343 * spinlock.h: ...here. Remove locking.
344 * internals.h: Remove __pthread_set_own_extricate_if prototype.
346 * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
347 (rwlock_rd_extricate_func): Don't determine self, let
348 __pthread_lock do it.
349 (rwlock_wr_extricate_func): Likewise.
350 (rwlock_have_already): Optimize *pself handling a bit.
352 * mutex.c: Use __builtin_expect.
353 * pthread.c: Likewise.
355 2000-08-02 Andreas Jaeger <aj@suse.de>
357 * sysdeps/s390/pspinlock.c: New file.
358 * sysdeps/s390/pt-machine.h: New file.
359 Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
361 2000-07-12 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
363 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
365 * sysdeps/mips/pt-machine.h (testandset): Likewise.
367 2000-07-26 Andreas Jaeger <aj@suse.de>
369 * pthread.c: Initialize p_sem_avail.
371 2000-07-25 Ulrich Drepper <drepper@redhat.com>
373 * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
374 * semaphore.c: Handle spurious wakeups.
376 * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
377 for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
379 * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
380 (__pthread_wait_for_restart): Likewise.
382 * condvar.c (pthread_cond_wait): Also check whether thread is
383 cancelable before aborting loop.
384 (pthread_cond_timedwait): Likewise.
386 * signals.c (pthread_sighandler): Remove special code to restrore
388 (pthread_sighandler_t): Likewise.
390 2000-07-25 Mark Kettenis <kettenis@gnu.org>
392 * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
393 * pthread.c: Include <resolv.h>.
394 (_res): Undefine. Add extern declaration.
396 2000-07-24 Ulrich Drepper <drepper@redhat.com>
398 * pthread.c (__pthread_initial_thread): Update initializer.
399 (__pthread_manager_thread): Likewise.
400 (pthread_initialize): Move setrlimit call to...
401 (__pthread_initialize_manager): ...here.
402 (__pthread_reset_main_thread): Reset also soft limit on stack size.
404 * condvar.c: Handle spurious wakeups. [PR libc/1749].
405 * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
407 2000-07-21 Ulrich Drepper <drepper@redhat.com>
409 * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
410 __compare_and_swap to define testandset.
411 * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
412 Define IMPLEMENT_TAS_WITH_CAS.
414 2000-07-20 Ulrich Drepper <drepper@redhat.com>
416 * Makefile: Pass -z nodelete to linker for libpthread.so
417 generation if it understand this option.
419 2000-07-18 Mark Kettenis <kettenis@gnu.org>
421 * manager.c (pthread_handle_create): Remove initialization of
422 new_thread->p_res._sock.
424 2000-07-19 Kaz Kylheku <kaz@ashi.footprints.net>
426 Bugfixes to the variant of the code for machines with no compare
429 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
430 node was not being properly enqueued, due to failing to update
431 the lock->__status field.
433 * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
434 being set inappropriately, causing the suspend function to be called
435 with a null self pointer and crash.
437 2000-07-18 Ulrich Drepper <drepper@redhat.com>
439 * spinlock.h (__pthread_alt_trylock): Fix code used if no
440 compare&swap is available.
442 * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
445 * pthread.c (pthread_initialize): Don't use sysconf to determine
446 whether the machine has more than one processor.
448 * spinlock.c (__pthread_alt_timedlock): Add back one of the
449 removed thread_self calls.
451 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
453 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
454 __compare_and_swap to compare_and_swap in code which assumes
455 compare swap is available.
457 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
459 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
460 bug whereby thr field of waitnode structure would not be correctly
461 set unless a null self pointer is passed to the functions.
462 Eliminated redundant calls to thread_self().
464 2000-07-18 Jakub Jelinek <jakub@redhat.com>
466 * pthread.c (__pthread_initialize_manager): Lock
467 __pthread_manager_thread.p_lock before calling clone.
469 2000-05-05 H.J. Lu <hjl@gnu.org>
471 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
472 have acquire semantics.
473 (__compare_and_swap_with_release_semantics): New inline
475 (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
477 2000-01-28 Hans Boehm <hboehm@exch.hpl.hp.com>
479 * manager.c: Fix the problem with signals at startup.
480 Change the way that thread stacks are allocated on IA64.
481 Clean up some of the guard page allocation stuff.
483 1999-12-19 H.J. Lu <hjl@gnu.org>
485 * internals.h (page_roundup): New.
486 * attr.c (__pthread_attr_setguardsize); Use page_roundup
488 * manager.c (pthread_allocate_stack): Make sure guardaddr is
489 page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
492 1999-12-17 Hans Boehm <hboehm@exch.hpl.hp.com>
494 * manager.c (pthread_allocate_stack): Unmap the stack top
495 if failed to map the stack bottom.
497 (pthread_free): Fix the guard page.
499 * pthread.c (pthread_initialize): Set rlimit correctly for
500 NEED_SEPARATE_REGISTER_STACK.
502 1999-12-16 H.J. Lu <hjl@gnu.org>
504 * pthread.c (__pthread_initialize_manager): Pass
505 __pthread_manager_thread_bos instead of
506 __pthread_manager_thread_tos to __clone2.
508 1999-12-16 H.J. Lu <hjl@gnu.org>
510 * manager.c (pthread_allocate_stack): Correct the calculation
511 of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
514 1999-12-13 H.J. Lu <hjl@gnu.org>
516 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
517 bit after setting ar.ccv.
519 1999-12-12 H.J. Lu <hjl@gnu.org>
521 * manager.c (pthread_allocate_stack): Make the starting
522 address of the stack bottom page aligned. FIXME: it may
523 need changes in other places.
524 (pthread_handle_create): Likewise.
526 1999-12-11 Hans Boehm <hboehm@exch.hpl.hp.com>
528 * manager.c (pthread_allocate_stack): Handle
529 NEED_SEPARATE_REGISTER_STACK.
530 (pthread_handle_create): Likewise.
531 * pthread.c (__pthread_initialize_manager): Likewise.
533 * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
535 1999-12-02 H.J. Lu <hjl@gnu.org>
537 * sysdeps/ia64/pt-machine.h: New.
539 2000-07-13 Ulrich Drepper <drepper@redhat.com>
541 * wrapsyscall.c: Mark non-__ protected names as weak.
544 2000-07-12 Bruno Haible <haible@clisp.cons.org>
546 * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
548 2000-07-12 Ulrich Drepper <drepper@redhat.com>
550 * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
551 Add tests also to new alternative spinlock implementation.
552 * spinlock.h: Likewise.
553 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
555 2000-07-06 Ulrich Drepper <drepper@redhat.com>
557 * Version: Export __sigaction.
558 * signals.c: Define __sigaction alias. Use __libc_sigaction instead
560 * pthread.c: Use __libc_sigaction instead of __sigaction.
562 * condvar.c: Implement pthread_condattr_getpshared and
563 pthread_condattr_setpshared.
564 * mutex.c: Implement pthread_mutexattr_getpshared and
565 pthread_mutexattr_setpshared.
566 * Versions: Export new functions.
567 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
569 * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
570 (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
573 2000-07-04 Greg McGary <greg@mcgary.org>
575 * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
576 pragmas. Include bp-sym.h only if _LIBC.
578 2000-07-04 Ulrich Drepper <drepper@redhat.com>
580 * spinlock.c (__pthread_unlock): Properly place write barrier.
581 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
583 2000-07-03 Ulrich Drepper <drepper@redhat.com>
585 * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
586 faster on SMP systems. No more emulation of compare&swap for adaptive
588 * spinlock.h: Likewise.
589 * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
590 Replace fast with adaptive mutex.
591 * mutex.c: Rewrite for replacement of fast by adaptive mutex.
592 * condvar.c: Likewise.
593 * pthread.c: Define and initialize __pthread_smp_kernel variable.
594 * internals.h: Declare __pthread_smp_kernel.
595 * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
596 _pthread_fastlock structure.
597 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
599 * pthread.c: Remove initialization to zero from global variables.
601 2000-06-29 Jakub Jelinek <jakub@redhat.com>
603 * shlib-versions: Make sparc64 GLIBC_2.2+ only.
605 2000-06-28 Greg McGary <greg@mcgary.org>
607 * weaks.c: Wrap BP_SYM () around weak extern declarations of
608 pthread functions that have pointers in their return+arg signatures.
610 2000-06-27 Greg McGary <greg@mcgary.org>
612 * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
613 extern declarations of pthread functions that have pointers in
614 their return+arg signatures.
616 2000-06-26 Ulrich Drepper <drepper@redhat.com>
618 * Makefile (tests): Add ex11. Add rules to build it.
619 * Examples/ex11.c: New file.
620 * rwlock.c: Fix complete braindamaged previous try to implement
623 * spinlock.c: Pretty print.
625 2000-06-25 Ulrich Drepper <drepper@redhat.com>
627 * Makefile (tests): Add ex10. Add rules to build it.
628 * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
629 pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
630 * condvar.c (pthread_cond_wait): Allow mutex of kind
631 PTHREAD_MUTEX_TIMED_NP.
632 (pthread_cond_timedwait_relative): Likewise.
633 * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
634 (__pthread_mutex_trylock): Use __pthread_alt_trylock for
635 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
636 (__pthread_mutex_lock): Use __pthread_alt_lock for
637 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
638 (__pthread_mutex_timedlock): New function.
639 (__pthread_mutex_unlock): Use __pthread_alt_unlock for
640 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
641 (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
642 (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
643 * spinlock.c: Implement alternate fastlocks.
644 * spinlock.h: Add prototypes.
645 * Examples/ex10.c: New file.
646 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
647 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
649 * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
650 (__pthread_rwlock_timedrdlock): New function.
651 (__pthread_rwlock_timedwrlock): New function.
652 Use laternate fastlock function everywhere.
654 2000-06-21 Andreas Jaeger <aj@suse.de>
656 * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
659 * join.c: Include <stdlib.h> for exit prototype.
661 2000-06-20 Ulrich Drepper <drepper@redhat.com>
663 * sysdeps/i386/useldt.h: Include <stdlib.h>.
665 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
666 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
668 * Makefile (libpthread-routines): Add barrier.
669 (tests): Add ex9. Add rule to build ex9.
670 * Versions: Export barrier functions.
671 * barrier.c: New file.
672 * Examples/ex9.c: New file.
673 * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
674 * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
675 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
677 2000-06-19 H.J. Lu <hjl@gnu.org>
679 * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
680 HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
681 (compare_and_swap_with_release_semantics): New. Default to
682 compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
685 * spinlock.c (__pthread_unlock): Call
686 compare_and_swap_with_release_semantics () instead of
689 2000-06-19 Ulrich Drepper <drepper@redhat.com>
691 * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
693 * sysdeps/pthread/timer_delete.c: Likewise.
694 * sysdeps/pthread/timer_getoverr.c: Likewise.
695 * sysdeps/pthread/timer_gettime.c: Likewise.
696 * sysdeps/pthread/timer_settime.c: Likewise.
698 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
700 Timer nodes are now reference counted, and can be marked
701 as deleted. This allows for the safe release of the global mutex
702 in the middle without losing the timer being operated on.
704 * sysdeps/pthread/posix-timer.h (struct timer_node): The inuse
705 member is now an enum with three values, so that an intermediate
706 state can be represented (deleted but not free for reuse yet).
707 New refcount member added.
708 * sysdeps/pthread/timer_routines.c: Likewise.
710 * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
711 timer_valid): New inline functions added.
713 * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
714 restructured, recursive deadlock bug fixed.
716 * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
717 timer_addref to ensure that timer won't be deleted while mutex is not
718 held. Also uses timer_invalid to perform validation of timer handle.
719 * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
720 * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
722 2000-06-14 Ulrich Drepper <drepper@redhat.com>
724 * shlib-versions: Add entry for SH.
725 Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
727 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
729 A few optimizations. Got rid of unnecessary wakeups of timer threads,
730 tightened up some critical regions and micro-optimized some list
733 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
734 Returns int value now to indicate whether timer was queued at head.
735 * sysdeps/pthread/posix-timer.h: Likewise.
736 * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
737 new return value from __timer_thread_queue_timer to avoid waking
738 up timer thread unnecessarily.
740 * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
741 inuse flag, because this requires mutex to be held. Callers updated
742 to do the check when they have the mutex.
743 * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
745 * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
746 regions: avoids making system calls while holding timer mutex, and
747 a few computations were moved outside of the mutex as well.
748 * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
750 * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
751 to list_unlink_ip, meaning idempotent. Pointer manipulation
752 changed to get better better code out of gcc.
753 * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
754 version of list_unlink added here.
755 * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
756 function in all places: idempotent one for timers, non-idempotent
757 one for thread nodes.
758 * sysdeps/pthread/timer_settime: Likewise.
759 * sysdeps/pthread/timer_routines.c: Likewise.
761 2000-06-13 Ulrich Drepper <drepper@redhat.com>
763 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
764 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
766 * sysdeps/pthread/Makefile: Remove tests definition.
768 2000-06-12 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
769 Yutaka Niibe <gniibe@chroot.org>
771 * sysdeps/sh/pspinlock.c: New file.
772 * sysdeps/sh/pt-machine.h: New file.
774 2000-06-12 Ulrich Drepper <drepper@redhat.com>
776 * Makefile (tests): Add joinrace.
778 * Examples/ex6.c: Test return value of pthread_join.
780 2000-06-11 Geoff Keating <geoffk@cygnus.com>
782 * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
783 (__pthread_spin_trylock): Implement.
784 (__pthread_spin_unlock): Implement.
785 (__pthread_spin_init): Implement.
786 (__pthread_spin_destroy): Implement.
788 2000-06-10 Ulrich Drepper <drepper@redhat.com>
790 * sysdeps/pthread/timer_routines.c (list_append): Little fix to
791 really append the entry.
793 2000-06-10 Andreas Jaeger <aj@suse.de>
795 * lockfile.c (__fresetlockfiles): Remove unused variable fp.
797 2000-06-10 Kaz Kylheku <kaz@ashi.footprints.net>
799 * sysdeps/pthread/timer_create.c: Thread matching now done on
800 clock type as well as thread attributes.
801 There are individual global signal-delivering threads for
802 different clock types.
803 * sysdeps/pthread/posix-timer.h: Likewise.
804 * sysdeps/pthread/timer_routines.c: Likewise.
806 * sysdeps/pthread/timer_routines.c: Thread allocation and
807 deallocation function now remembers to put thread on active
808 list and remove from active list.
809 Thus now the feature of binding multiple timers
810 to a single thread actually works.
812 2000-06-10 Ulrich Drepper <drepper@redhat.com>
814 * pthread.c (__pthread_create_2_1): Optimize a bit.
816 * internals.h (invalid_handle): Also test for p_terminated != 0.
817 (nonexisting_handle): New function. Same as old invalid_handle.
818 * join.c (pthread_join): Use nonexisting_handle instead of
819 invalid_handle to test for acceptable thread handle.
820 * manager.c (pthread_handle_free): Likewise.
821 * joinrace.c: New file.
822 Reported by Permaine Cheung <pcheung@cygnus.com>.
824 2000-06-08 Ulrich Drepper <drepper@redhat.com>
826 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
827 Correct handling of matching variable.
829 * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
832 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
833 Be prepared for empty timer list.
835 * sysdeps/pthread/timer_create.c (timer_create): Correct names of
836 CPUTIME clock ID. Add support for thread clocks.
838 * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
839 subtraction were switched.
841 * sysdeps/pthread/timer_routines.c (init_module): Use
842 THREAD_MAXNODES threads.
844 * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
845 * sysdeps/pthread/timer_create.c: Fill in creator_pid.
846 * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
847 with sigqueueinfo is this system call is available.
849 * sysdeps/pthread/timer_create.c (timer_create): Allow
850 CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
852 * sysdeps/pthread/Makefile: New file. Add rules to build timer
854 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
856 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
858 * sysdeps/pthread/posix-timer.h: New file.
859 * sysdeps/pthread/timer_create.c: New file.
860 * sysdeps/pthread/timer_delete.c: New file.
861 * sysdeps/pthread/timer_getoverr.c: New file.
862 * sysdeps/pthread/timer_gettime.c: New file.
863 * sysdeps/pthread/timer_routines.c: New file.
864 * sysdeps/pthread/timer_settime.c: New file.
865 * sysdeps/pthread/tst-timer.c: New file.
867 2000-06-08 Ulrich Drepper <drepper@redhat.com>
869 * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
870 LINK_MAX definitions if necessary.
872 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
874 Added missing fork time handling of global libio lock.
876 * lockfile.c (__fresetlockfiles): Now also resets the list lock,
877 not just the individual stream locks. Rewritten to use new
878 iterator interface provided by libio rather than accessing
881 * lockfile.c (__flockfilelist, _funlockfilelist): New functions
882 which lock and unlock the stream list using the new interface
884 * internals.h: Likewise.
886 * ptfork.c (__fork): Now calls __flockfilelist before fork,
887 and __funlockfilelist in the parent after the fork.
888 Child still calls __fresetlockfiles as before.
890 * linuxthreads.texi: Now explains what happens to streams at
891 fork time. Also whole new section on forking and thread added.
892 Definition of pthread_atfork moved out of Miscellaneous Functions
895 2000-06-04 Jakub Jelinek <jakub@redhat.com>
897 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
898 Add missing register.
899 * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
901 2000-06-02 Jakub Jelinek <jakub@redhat.com>
903 * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
904 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
905 * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
907 2000-05-31 Andreas Jaeger <aj@suse.de>
909 * sysdeps/mips/pspinlock.c: Implement spinlocks.
911 2000-05-28 Ulrich Drepper <drepper@redhat.com>
913 * spinlock.c (__pthread_lock): Remove ASSERT.
915 * Makefile (tests): Add ex8.
916 * Examples/ex8.c: New file.
918 2000-05-12 Kaz Kylheku <kaz@ashi.footprints.net>
920 Bugfix: The pthread_atfork mechanism now takes care of its
921 own internal mutex at fork time.
923 * ptfork.c (__fork): Revised so that the mutex is held across
924 the fork operation and while the handlers are called, and so that
925 the child resets the mutex.
927 * linuxthreads.texi: Updated pthread_atfork documentation to make
928 it clear that fork and pthread_atfork can't be reentered from
929 atfork handlers, that pthread_atfork and fork are mutually atomic,
930 and that the handlers are inherited by the child process.
932 2000-05-24 Ulrich Drepper <drepper@redhat.com>
934 * Makefile (libpthread-routines): Add pspinlock.
935 * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
936 Use struct _pthread_fastlock instead of pthread_spinlock_t.
937 * condvar.c: Likewise.
938 * internals.h: Likewise.
940 * manager.c: Likewise.
942 * pthread.c: Likewise.
943 * rwlock.c: Likewise.
944 * semaphore.c: Likewise.
945 * signals.c: Likewise.
946 * spinlock.h: Likewise.
947 * spinlock.c: Likewise. Remove pthread_spin_lock functions.
948 * sysdeps/alpha/pspinlock.c: New file.
949 * sysdeps/arm/pspinlock.c: New file.
950 * sysdeps/i386/pspinlock.c: New file.
951 * sysdeps/m68k/pspinlock.c: New file.
952 * sysdeps/mips/pspinlock.c: New file.
953 * sysdeps/powerpc/pspinlock.c: New file.
954 * sysdeps/sparc/sparc32/pspinlock.c: New file.
955 * sysdeps/sparc/sparc64/pspinlock.c: New file.
956 * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
957 back to _pthread_fastlock. Define new pthread_spinlock_t.
959 2000-05-24 Andreas Jaeger <aj@suse.de>
961 * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
963 2000-05-21 Jakub Jelinek <jakub@redhat.com>
965 * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
967 2000-05-13 Jakub Jelinek <jakub@redhat.com>
969 * internals.h (__RES_PTHREAD_INTERNAL): Define.
971 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
973 * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
974 object state is represented with additional bits which distinguish
975 whether that state was set up in the current process, or
976 in an ancestor process. If that state was set in an ancestor,
977 it means that a fork happened while thread was executing the init
978 function. In that case, the state is reset to NEVER.
979 * mutex.c (__pthread_once_fork_prepare): New function.
980 (__pthread_once_fork_child): Likewise
981 (__pthread_once_fork_parent): Likewise
982 (__pthread_reset_pthread_once): Removed.
983 * ptfork.c (__fork): Call new handlers in mutex.c.
984 * internals.h: Declarations of new mutex.c functions added.
985 Declaration of removed function deleted.
986 * linuxthreads.texi: Updated documentation about pthread_once
987 to clarify what happens under cancellation and forking.
989 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
991 * internals.h: New thread manager request type, REQ_KICK.
992 * join.c (pthread_exit): main thread now calls exit() instead
993 of _exit() in order to proper process cleanup.
994 * manager.c (__pthread_manager): Do not terminate manager
995 after unblocking main thread; wait for main thread's
996 REQ_PROCESS_EXIT request instead.
997 Also, added REQ_KICK case to handle new request; this just does
999 * manager.c (pthread_exited): Do not terminate manager after
1000 unblocking main thread.
1001 * manager.c (__pthread_manager_sighandler): If the main thread
1002 is waiting for all other threads to die, send a REQ_KICK into
1003 the thread manager request pipe to get it to clean out the threads
1004 and unblock the main thread as soon as possible. This fixes
1005 the 2000 millisecond hang on shutdown bug.
1006 * Examples/ex7.c: New file, tests shutdown behavior when all threads
1007 including the main one call pthread_exit(), or implicitly do so.
1008 * Makefile (tests): Add ex7.
1010 2000-05-05 Andreas Jaeger <aj@suse.de>
1012 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1013 (pthread_getcpuclockid): Correct test for ourselves.
1015 2000-05-05 Ulrich Drepper <drepper@redhat.com>
1017 * internals.h (struct _pthread_descr_struct): Reorganization.
1018 Allocate room for 16 pointers at head of the structure for future
1019 thread-local data handling. Move p_self member in this area.
1020 * manager.c (pthread_handle_create): Adjust use of p_self.
1021 * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
1022 * pthread.c (__pthread_initial_thread): Adjust initialization.
1023 (__pthread_manager_thread): Likewise.
1025 2000-04-29 Bruno Haible <haible@clisp.cons.org>
1027 * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
1028 for eventmask larger than 1 word.
1030 2000-04-27 Ulrich Drepper <drepper@redhat.com>
1032 * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
1033 * pthread.c (__pthread_initialize_minimal): New function. Perform
1034 minimal initialization.
1035 (pthread_initialize): Remove this code here.
1036 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again. We
1037 are working around the problem in glibc.
1039 2000-04-25 Ulrich Drepper <drepper@redhat.com>
1041 * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
1042 now. First gcc must be fixed (more concrete: libgcc).
1044 2000-04-24 Ulrich Drepper <drepper@redhat.com>
1046 * pthread.c: Remove special treatement for interrupt handlers on x86.
1047 * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
1048 * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
1050 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
1052 2000-04-24 Mark Kettenis <kettenis@gnu.org>
1054 * join.c (pthread_exit): Set p_terminated after reporting the
1055 termination event instead of before.
1057 2000-04-20 Jakub Jelinek <jakub@redhat.com>
1059 * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
1062 2000-04-18 Andreas Jaeger <aj@suse.de>
1064 * Versions: Use ld instead of ld.so.
1066 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1068 * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
1069 Remove the typedef keyword.
1071 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1073 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
1075 (READ_MEMORY_BARRIER): Define.
1076 * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
1078 * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
1081 2000-04-17 Ulrich Drepper <drepper@redhat.com>
1083 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1084 (pthread_getcpuclockid): Don't compare thread_id with thread_self,
1085 use thread_handle().
1087 2000-04-16 Ulrich Drepper <drepper@redhat.com>
1089 * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
1090 if fast mutex is used. Don't initialize `already_canceled' twice.
1091 Correctly test for return value of timedsuspend.
1093 * pthread.c: Correct long-time braino. We never set SA_SIGINFO and
1094 therefore don't need the _rt versions of the signal handlers.
1096 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1098 * pthread.c (pthread_yield): New function.
1099 * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
1100 * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
1101 * internals.h: Declare __pthread_yield.
1103 * pthread.c (pthread_initialize): Avoid a bit more code if
1104 realtime signals are known to exist.
1106 * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
1107 to dynamically detect RT signals and avoid generating compatibility
1108 functions with old kernel.
1109 * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
1110 __pthread_restart_new directly.
1111 (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
1112 __pthread_wait_for_restart_signal directly.
1113 (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
1114 __pthread_timedsuspend_new directly.
1116 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1118 * condvar.c: Remove all the special code to handle cond_timedwait.
1119 Use timedsuspend instead.
1120 * internals.h: Declare __pthread_timedsuspend_old,
1121 __pthread_timedsuspend_new, and __pthread_timedsuspend.
1122 Remove declaration of __pthread_init_condvar.
1123 * pthread.c: Define __pthread_timedsuspend variable.
1124 (__pthread_timedsuspend_old): New function. Timed suspension
1125 implementation for old Linux kernels.
1126 (__pthread_timedsuspend_new): New function. Timed suspension
1127 implementation for new Linux kernels.
1128 * restart.h (timedsuspend): New function. Call appropriate
1129 suspension function through __pthread_timedsuspend.
1130 * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
1132 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1134 * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
1136 * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
1138 * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
1139 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1141 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
1142 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1144 2000-04-14 Andreas Jaeger <aj@suse.de>
1146 * weaks.c: Fix typo.
1148 * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
1149 2.2 for linuxthreads.
1151 2000-04-13 Ulrich Drepper <drepper@redhat.com>
1153 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1154 (pthread_getcpuclockid): Fix typo.
1156 2000-04-12 Ulrich Drepper <drepper@redhat.com>
1158 * Makefile (libpthread-routines): Add getcpuclockid.
1159 * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
1160 * sysdeps/pthread/getcpuclockid.c: New file.
1161 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
1162 * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
1164 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
1166 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1168 * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
1169 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1170 and pthread_spin_unlock.
1171 * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
1172 into pthread_spinlock_t. Change all uses.
1173 * spinlock.c: Implement pthread_spin_lock.
1174 Rename __pthread_unlock to __pthread_spin_unlock and define weak
1175 alias for real name.
1176 Define pthread_spin_trylock, pthread_spin_init, and
1177 pthread_spin_destroy.
1178 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1179 * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
1180 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1181 * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
1182 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1183 and pthread_spin_unlock.
1184 * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
1185 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1186 * condvar.c: Likewise.
1187 * internals.h: Likewise.
1189 * manager.c: Likewise.
1190 * mutex.c: Likewise.
1191 * pthread.c: Likewise.
1192 * rwlock.c: Likewise.
1193 * semaphore.c: Likewise.
1194 * signals.c: Likewise.
1196 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
1198 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1200 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1202 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
1203 _POSIX_SHARED_MEMORY_OBJECTS.
1205 2000-04-11 Andreas Jaeger <aj@suse.de>
1207 * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
1208 (__compare_and_swap): Mark as modifying memory.
1210 2000-04-11 Geoff Keating <geoffk@cygnus.com>
1212 * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
1214 (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
1215 Don't have the 'asm' __volatile__.
1217 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1219 * internals.h: Define MEMORY_BARRIER as empty if not defined already.
1220 * spinlock.c (__pthread_lock): Add memory barriers.
1221 (__pthread_unlock): Likewise.
1222 * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
1224 (RELEASE): Not needed anymore.
1225 (__compare_and_swap): Mark asm as modifying memory.
1226 * sysdeps/powerpc/pt-machine.h (sync): Remove. Replace with definition
1228 (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
1229 * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
1230 (MEMORY_BARRIER): Define using stbar.
1231 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
1233 (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
1234 Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
1235 Mike Burrows <m3b@pa.dec.com>.
1237 2000-04-09 Ulrich Drepper <drepper@redhat.com>
1239 * signals.c (sigaction): Fix return value for the case SIG is one
1240 of the signals the implementation uses.
1241 Patch by Xavier.Leroy@inria.fr.
1243 2000-04-01 Andreas Jaeger <aj@suse.de>
1245 * attr.c: Use shlib-compat macros.
1246 * oldsemaphore.c: Likewise.
1247 * pthread.c: Likewise.
1248 * weaks.c: Likewise.
1250 2000-03-26 Ulrich Drepper <drepper@redhat.com>
1252 * semaphore.c (sem_timedwait): New function.
1253 Patch by Carl Mailloux <carlm@oricom.ca>.
1254 * semaphore.h: Declare sem_timedwait.
1255 * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
1257 2000-03-26 Roland McGrath <roland@baalperazim.frob.com>
1259 * sysdeps/pthread/Makefile: File removed.
1261 2000-03-23 Ulrich Drepper <drepper@redhat.com>
1263 * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
1264 * internals.h (__pthread_reset_pthread_once): Add prototype.
1265 * ptfork.c (__fork): Call __pthread_reset_pthread_once.
1267 * manager.c (pthread_handle_create): Store ID of new thread before
1270 2000-03-21 Ulrich Drepper <drepper@redhat.com>
1272 * attr.c: Use new macros from shlib-compat.h to define versions.
1273 * oldsemaphore.c: Likewise.
1274 * semaphore.c: Likewise.
1275 * weaks.c: Likewise.
1277 * pthread.c: Update for new SHLIB_COMPAT definition.
1279 * manager.c (__pthread_manager): Unmask debug signal.
1281 * pthread.c (pthread_initialize): Test for address of __dso_handle
1282 being NULL, not value. Use __on_exit, not on_exit.
1283 Patch by Andreas Jaeger <aj@suse.de>.
1285 * pthread.c: Use new macros from shlib-compat.h to define versions.
1287 2000-03-19 Ulrich Drepper <drepper@redhat.com>
1289 * pthread.c (pthread_initialize): Instead of on_exit use
1290 __cxa_atexit if __dso_label is available to allow unloading the
1291 libpthread shared library.
1293 2000-03-16 Ulrich Drepper <drepper@redhat.com>
1295 * condvar.c: Make tests for ownership of mutex less strict.
1297 2000-03-14 Ulrich Drepper <drepper@redhat.com>
1299 * condvar.c (pthread_cond_wait): Check whether mutex is owned by
1300 current thread and return error if not.
1301 (pthread_cond_timedwait_relative_old): Likewise.
1302 (pthread_cond_timedwait_relative_new): Likewise.
1304 * mutex.c (__pthread_once): Handle cancelled init function correctly.
1305 (pthread_once_cancelhandler): New function.
1306 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1308 2000-03-14 Andreas Jaeger <aj@suse.de>
1310 * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
1312 (pthread_handle_sigrestart_rt): Likewise.
1313 * signals.c (pthread_sighandler_rt): Likewise.
1315 2000-03-02 Andreas Jaeger <aj@suse.de>
1317 * sysdeps/pthread/bits/libc-lock.h: Fix typo.
1318 Reported by Sean Chen <sean.chen@turbolinux.com>.
1320 2000-02-28 Andreas Jaeger <aj@suse.de>
1322 * rwlock.c: Fix typo.
1324 2000-02-27 Ulrich Drepper <drepper@redhat.com>
1326 * rwlock.c: Define __* variants of the functions and make old names
1328 * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
1329 * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
1331 2000-02-25 Andreas Jaeger <aj@suse.de>
1333 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1334 pwrite64, lseek64, open64, and __open64 with version 2.2.
1336 2000-02-22 Ulrich Drepper <drepper@redhat.com>
1338 * semaphore.h (SEM_FAILED): Use 0 not NULL.
1340 2000-02-14 Ulrich Drepper <drepper@redhat.com>
1342 * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
1343 nanosleep does not work either. Get absolute time inside the
1345 (pthread_cond_timedwait_relative_new): Likewise.
1346 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1348 2000-02-13 Andreas Jaeger <aj@suse.de>
1350 * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
1351 (pthread_cond_timedwait_relative_old): Likewise.
1353 2000-02-13 Ulrich Drepper <drepper@redhat.com>
1355 * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
1356 but keep the code around. A bug in the kernel prevent us from
1358 (pthread_cond_timedwait_relative_new): Likewise.
1359 (PR libc/1597 and libc/1598).
1361 2000-02-01 Kaz Kylheku <kaz@ashi.footprints.net>
1363 * condvar.c (pthread_cond_timedwait_relative_old): Do tight
1364 loop around nanosleep calls instead of around most of the function
1365 (pthread_cond_timedwait_relative_new): Likewise.
1366 body. Got rid of backwards goto and one local.
1368 2000-01-31 Ulrich Drepper <drepper@redhat.com>
1370 * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
1371 before every nanosleep call to account for time spent in the rest
1373 (pthread_cond_timedwait_relative_new): Likewise.
1374 Patch by khendricks@ivey.uwo.ca (PR libc/1564).
1376 2000-01-29 Ulrich Drepper <drepper@redhat.com>
1378 * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
1379 from nanosleep call so that in case we restart we only wait for the
1381 (pthread_cond_timedwait_relative_new): Likewise.
1382 Patch by khendricks@ivey.uwo.ca (PR libc/1561).
1384 2000-01-18 Ulrich Drepper <drepper@cygnus.com>
1386 * manager.c (pthread_allocate_stack): Compute guard page address
1387 correctly. Patch by HJ Lu.
1389 * sysdeps/pthread/pthread.h: Define
1390 PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
1392 2000-01-16 Ulrich Drepper <drepper@cygnus.com>
1394 * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
1395 preference handling.
1396 (pthread_rwlockattr_setkind_np): Allow
1397 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
1398 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1400 2000-01-12 Ulrich Drepper <drepper@cygnus.com>
1402 * internals.h (pthread_readlock_info): New structure.
1403 (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
1404 p_untracked_readlock_count.
1405 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1406 Add initializers for new fields.
1407 * manager.c (pthread_free): Free read/write lock lists.
1408 * queue.h (queue_is_empty): New function.
1409 * rwlock.c: Implement requirements about when readers should get
1411 * sysdeps/pthread/pthread.h
1412 (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
1413 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
1414 Define this name as well.
1415 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1417 2000-01-05 Ulrich Drepper <drepper@cygnus.com>
1419 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1420 Adjust initializers for struct _pthread_descr_struct change.
1421 * internals.h (struct _pthread_descr_struct): Move new elements to
1424 2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
1426 Redesigned how cancellation unblocks a thread from internal
1427 cancellation points (sem_wait, pthread_join,
1428 pthread_cond_{wait,timedwait}).
1429 Cancellation won't eat a signal in any of these functions
1430 (*required* by POSIX and Single Unix Spec!).
1431 * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
1432 simultaneous condition variable signal (not required by POSIX
1433 or Single Unix Spec, but nice).
1434 * spinlock.c: __pthread_lock queues back any received restarts
1435 that don't belong to it instead of assuming ownership of lock
1436 upon any restart; fastlock can no longer be acquired by two threads
1438 * restart.h: Restarts queue even on kernels that don't have
1439 queued real time signals (2.0, early 2.1), thanks to atomic counter,
1440 avoiding a rare race condition in pthread_cond_timedwait.
1442 1999-12-31 Andreas Jaeger <aj@suse.de>
1444 * internals.h: Remove duplicate prototype declarations.
1446 * weaks.c: Remove __THROW from prototypes since the file is not
1447 compiled by a C++ compiler.
1448 * internals.h: Likewise.
1450 1999-12-30 Andreas Jaeger <aj@suse.de>
1452 * sysdeps/pthread/pthread.h: Move internal functions to...
1453 * sysdeps/pthread/bits/libc-lock.h: ...here.
1455 1999-12-29 Andreas Jaeger <aj@suse.de>
1457 * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
1459 1999-12-28 Ulrich Drepper <drepper@cygnus.com>
1461 * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
1464 * manager.c (__pthread_start): Add one more cast to prevent
1465 warning on 64bit machines.
1467 1999-12-21 Ulrich Drepper <drepper@cygnus.com>
1469 * manager.c (pthread_handle_create): Set p_pid of new thread
1470 before calling the callback function to report a new thread.
1472 1999-12-20 Andreas Jaeger <aj@suse.de>
1474 * pthread.c (pthread_initialize): Move getrlimit call after
1477 1999-12-18 Ulrich Drepper <drepper@cygnus.com>
1479 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1480 pwrite64, lseek64, open64, and __open64.
1481 * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
1482 pwrite64, lseek64, open64, and __open64.
1484 * manager.c (pthread_allocate_stack): Correct computation of
1485 new_thread_bottom. Correct handling of stack size and when the
1486 rlimit method to guard for stack growth is used.
1487 * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
1488 minus one pagesize (not two).
1490 1999-12-03 Andreas Jaeger <aj@suse.de>
1492 * Versions: Add __res_state with version GLIBC_2.2.
1494 * errno.c (__res_state): New function to return thread specific
1497 * pthread.c (pthread_initialize): Initialize p_resp.
1498 (__pthread_reset_main_thread): Also set p_resp.
1500 * manager.c (pthread_handle_create): Initialize p_resp.
1502 * internals.h: Add thread specific resolver state.
1503 Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
1505 1999-12-01 Ulrich Drepper <drepper@cygnus.com>
1507 * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
1509 * sysdeps/i386/i686/pt-machine.h: Likewise.
1510 Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
1512 1999-11-23 Ulrich Drepper <drepper@cygnus.com>
1514 * manager.c (pthread_start_thread_event): Initialize p_pid already
1517 1999-11-22 Ulrich Drepper <drepper@cygnus.com>
1519 * internals.h: Add prototype for __pthread_manager_event.
1520 * manager.c (__pthread_manager_event): New function.
1521 (pthread_start_thread_event): Correct computation of self.
1522 Use INIT_THREAD_SELF.
1523 * pthread.c (__pthread_manager_thread): Initialize p_lock.
1524 (__pthread_initialize_manager): Respect event flags also for creation
1525 of the manager thread.
1527 1999-11-08 Ulrich Drepper <drepper@cygnus.com>
1529 * pthread.c (__pthread_initialize_manager): Initialize
1530 __pthread_manager_thread.p_tid.
1532 1999-11-02 Ulrich Drepper <drepper@cygnus.com>
1534 * internals.h: Declare __pthread_last_event.
1535 * manager.c: Define __pthread_last_event.
1536 (pthread_handle_create): Set __pthread_last_event.
1537 (pthread_exited): Likewise.
1538 * join.c (pthread_exit): Likewise.
1540 * Makefile (libpthread-routines): Add events.
1541 * events.c: New file.
1542 * internals.h: Protect against multiple inclusion.
1543 Include thread_dbP.h header.
1544 (struct _pthread_descr_struct): Add new fields p_report_events and
1546 Declare event reporting functions.
1547 * join.c (pthread_exit): Signal event if this is wanted.
1548 * manager.c (__pthread_threads_events): New variable.
1549 (pthread_handle_create): Take new parameters with event information.
1550 Signal TD_CREATE event if wanted.
1551 (__pthread_manager): Adjust pthread_handle_create call.
1552 (pthread_start_thread_event): New function. Block until manager is
1553 finished and then call pthread_start_thread.
1554 (pthread_exited): Signal TD_REAP event if wanted.
1556 1999-10-26 Ulrich Drepper <drepper@cygnus.com>
1558 * restart.h (suspend_with_cancellation): Rewrite as a macro.
1560 * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
1562 1999-10-25 Andreas Jaeger <aj@suse.de>
1564 * internals.h: Remove K&R compatibility.
1565 * no-tsd.c: Likewise.
1566 * semaphore.h: Likewise.
1567 * signals.c: Likewise.
1568 * sysdeps/pthread/bits/libc-tsd.h: Likewise.
1569 * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
1570 * weaks.c: Likewise.
1572 1999-10-21 Xavier Leroy <Xavier.Leroy@inria.fr>
1574 * pthread.c: For i386, wrap pthread_handle_sigrestart and
1575 pthread_handle_sigcancel with functions that restore %gs from the
1576 signal context. For each signal handling function, two wrappers
1577 are required, one for a non-RT signal and one for a RT signal.
1578 * signal.c: For i386, add code to restore %gs from the signal
1579 context in pthread_sighandler and pthread_sighandler_rt.
1581 1999-10-17 Ulrich Drepper <drepper@cygnus.com>
1583 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
1585 1999-10-14 Ulrich Drepper <drepper@cygnus.com>
1587 * pthread.c (__pthread_initial_thread): Pass argument to
1588 PTHREAD_START_ARGS_INITIALIZER.
1589 (__pthread_manager_thread): Likewise.
1591 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
1592 initialize function.
1594 * manager.c (pthread_handle_create): Remove p_startfct initialization.
1596 * internals.h (_pthread_descr_struct): We don't need p_startfct field.
1598 1999-10-12 Ulrich Drepper <drepper@cygnus.com>
1600 * internals.h: Correct return types for __libc_read and __libc_write.
1602 1999-10-09 Andreas Jaeger <aj@suse.de>
1604 * internals.h: Add __new_sem_post to get prototype in
1605 manager.c; include semaphore.h for needed types.
1607 1999-10-08 Ulrich Drepper <drepper@cygnus.com>
1609 * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
1610 directly instead of calling sem_post which should not be necessary
1611 but is faster and might help in some case to work around problems.
1612 Patch by khendricks@ivey.uwo.ca [libc/1382].
1614 1999-10-08 Andreas Schwab <schwab@suse.de>
1616 * sysdeps/pthread/Subdirs: New file.
1619 1999-10-07 Ulrich Drepper <drepper@cygnus.com>
1621 * Implies: New file.
1622 * internals.h (struct _pthread_descr_struct): Add p_startfct.
1623 * manager.c (pthread_handle_create): Initialize p_startfct.
1624 * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
1626 1999-09-25 Ulrich Drepper <drepper@cygnus.com>
1628 * manager.c (__linuxthreads_pthread_threads_max): New variable.
1629 * specific.c (__linuxthreads_pthread_keys_max): New variable.
1630 (__linuxthreads_pthread_key_2ndlevel_size): New variable.
1632 * condvar.c (pthread_cond_timedwait_relative): Never return with
1633 EINTR. Patch by Andreas Schwab.
1635 1999-09-19 Ulrich Drepper <drepper@cygnus.com>
1637 * signals.c (sigaction): Correct last patch. Don't select
1638 pthread_sighandler_rt based on the signal number but instead of
1639 the SA_SIGINFO flag.
1641 1999-09-23 Ulrich Drepper <drepper@cygnus.com>
1643 * specific.c: Move definitions of struct pthread_key_struct and
1644 destr_function to ...
1645 * internals.h: ...here.
1647 1999-09-18 Ulrich Drepper <drepper@cygnus.com>
1649 * pthread.c (pthread_handle_sigrestart_rt): New function. Use
1650 this instead of pthread_handle_sigrestart if the signal is an RT
1653 * signals.c: Handle passing through of sighandler arguments also
1654 for real-time signals.
1656 1999-09-03 Andreas Schwab <schwab@suse.de>
1658 * ptfork.c (__fork): Renamed from fork and use __libc_fork. Add
1660 (__vfork): New function, alias vfork.
1661 * Versions: Export __fork, vfork, and __vfork in libpthread.
1663 1999-08-23 Andreas Schwab <schwab@suse.de>
1665 * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
1666 call to signal handler.
1668 1999-08-20 Ulrich Drepper <drepper@cygnus.com>
1670 * pthread.c (__pthread_reset_main_thread): Undo last change.
1671 (__pthread_kill_other_threads_np): Reset signal handlers for the
1672 signals we used in the thread implementation here.
1674 1999-08-19 Ulrich Drepper <drepper@cygnus.com>
1676 * pthread.c (__pthread_reset_main_thread): Reset signal handlers
1677 for the signals we used in the thread implementation [PR libc/1234].
1679 * Versions: Export __pthread_kill_other_threads_np from libpthread
1682 * signals.c: Pass sigcontext through wrapper to the user function.
1684 1999-08-01 Ulrich Drepper <drepper@cygnus.com>
1686 * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
1687 __libc_internal_tsd_set.
1689 1999-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1691 * manager.c: Remove inclusion of <linux/tasks.h> since it's not
1694 1999-07-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1696 * internals.h: Align _pthread_descr_struct to 32 bytes.
1697 Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
1700 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
1702 * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
1705 1999-07-09 Cristian Gafton <gafton@redhat.com>
1707 * Makefile (libpthread-routines): Add oldsemaphore routine.
1708 * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
1709 sem_trywait, and sem_wait to GLIBC_2.1.
1710 * oldsemaphore.c: New file.
1711 * semaphore.c: Add default_symbol_versions for the changed functions.
1712 (__new_sem_init): Rename from sem_init.
1713 (__new_sem_post): Rename from sem_post.
1714 (__new_sem_wait): Rename from sem_wait.
1715 (__new_sem_trywait): Rename from sem_trywait.
1716 (__new_sem_getvalue): Rename from sem_getvalue.
1717 (__new_sem_destroy): Rename from sem_destroy.
1719 1999-06-23 Robey Pointer <robey@netscape.com>
1721 * internals.h: Added p_nextlock entry to separate queueing for a
1722 lock from queueing for a CV (sometimes a thread queues on a lock
1723 to serialize removing itself from a CV queue).
1724 * pthread.c: Added p_nextlock to initializers.
1725 * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
1727 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
1729 * manager.c (pthread_handle_create): Free mmap region after stack
1730 if clone failed. Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
1732 1999-05-23 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1734 * man/pthread_cond_init.man: Correct example.
1735 Reported by Tomas Berndtsson <tomas@nocrew.org>.
1737 * linuxthreads.texi (Condition Variables): Likewise.
1739 1999-05-18 Jakub Jelinek <jj@ultra.linux.cz>
1741 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
1742 casx not cas, also successful casx returns the old value in rd
1743 and not the new value.
1745 1999-05-16 Xavier Leroy <Xavier.Leroy@inria.fr>
1747 * manager.c: If pthread_create() is given a NULL attribute
1748 and the thread manager runs with a realtime policy, set the
1749 scheduling policy of the newly created thread back to SCHED_OTHER.
1750 * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
1751 initialize the schedpolicy field of new_thread->p_start_args
1752 to that of the calling thread.
1754 1999-04-29 Ulrich Drepper <drepper@cygnus.com>
1756 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
1757 instruction does not allow memory element to use offset.
1759 1999-04-28 Ulrich Drepper <drepper@cygnus.com>
1761 * manager.c (pthread_allocate_stack): Optimize initialization of new
1764 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
1765 Don't use initializer since it is all zeroes.
1766 (__libc_once_define): Likewise.
1768 1999-04-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1770 * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
1771 doesn't exist anymore.
1772 * sysdeps/i386/Implies: Likewise.
1773 * sysdeps/m68k/Implies: Likewise.
1774 * sysdeps/mips/Implies: Likewise.
1775 * sysdeps/powerpc/Implies: Likewise.
1776 * sysdeps/sparc/sparc32/Implies: Likewise.
1777 * sysdeps/sparc/sparc64/Implies: Likewise.
1779 1999-04-15 Ulrich Drepper <drepper@cygnus.com>
1781 * sysdeps/alpha/bits/semaphore.h: Removed.
1782 * sysdeps/powerpc/bits/semaphore.h: Removed.
1783 * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
1784 * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
1785 * Makefile (headers): Remove bits/semaphore.h.
1787 * semaphore.h: Define _pthread_descr if necessary.
1788 Don't include limits.h. Define SEM_VALUE_MAX directly.
1790 (sem_t): Protect element names with leading __.
1791 Add declarations for sem_close, sem_open, and sem_unlink.
1792 * semaphore.c: Adjust all functions for new element names.
1793 Define sem_close, sem_open, and sem_unlink.
1794 * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
1796 * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
1799 1999-03-16 H.J. Lu <hjl@gnu.org>
1801 * specific.c (pthread_key_delete): Check th->p_terminated to see
1802 if the thread is running.
1804 * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
1805 Added to GLIBC_2.0 for libc.so.
1807 1999-02-12 H.J. Lu <hjl@gnu.org>
1809 * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
1810 __libc_allocate_rtsig): Added to GLIBC_2.1.
1812 * internals.h (DEFAULT_SIG_RESTART): Removed.
1813 (DEFAULT_SIG_CANCEL): Removed.
1815 * pthread.c (init_rtsigs, __libc_current_sigrtmin,
1816 __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
1817 (__pthread_sig_restart, __pthread_sig_cancel,
1818 __pthread_sig_debug): Initialized.
1819 (pthread_initialize): Call init_rtsigs () to initialize
1822 1999-02-03 H.J. Lu <hjl@gnu.org>
1824 * manager.c (__pthread_manager): Do block __pthread_sig_debug.
1825 Don't restart the thread which sent REQ_DEBUG.
1826 (pthread_start_thread): Check if __pthread_sig_debug > 0
1829 * pthread.c (__pthread_initialize_manager): Suspend ourself
1830 after sending __pthread_sig_debug to gdb instead of
1831 __pthread_sig_cancel.
1833 1999-01-24 H.J. Lu <hjl@gnu.org>
1835 * manager.c (__pthread_manager): Delete __pthread_sig_debug
1836 from mask if __pthread_sig_debug > 0.
1837 (pthread_handle_create): Increment __pthread_handles_num.
1839 * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
1840 * pthread.c (__pthread_initialize_manager): Likewise.
1842 * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
1843 instead of __libc_allocate_rtsig (2).
1844 (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
1845 instead of __pthread_sig_cancel.
1846 (pthread_handle_sigdebug): Fix comments.
1848 1999-01-21 Ulrich Drepper <drepper@cygnus.com>
1850 * manager.c (pthread_allocate_stack): Set
1851 __pthread_nonstandard_stacks if user-specified stack is used.
1853 1999-01-16 Ulrich Drepper <drepper@cygnus.com>
1855 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
1856 _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
1858 1999-01-07 Xavier Leroy <Xavier.Leroy@inria.fr>
1860 * pthread.c: Use a third signal __pthread_sig_debug distinct
1861 from __pthread_sig_cancel to notify gdb when a thread is
1863 * manager.c: Likewise.
1864 * internals.h: Likewise.
1865 * signals.c: The implementation of sigwait(s) assumed that
1866 all signals in s have signal handlers already attached.
1867 This is not required by the standard, so make it work
1868 also if some of the signals have no handlers.
1870 1999-01-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
1872 * linuxthreads.texi: Remove pointers from first @node. Move old
1873 @node spec inside comment.
1875 1998-12-31 Ulrich Drepper <drepper@cygnus.com>
1877 * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
1880 1998-12-29 Ulrich Drepper <drepper@cygnus.com>
1882 * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
1883 lock. Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
1885 1998-12-21 Ulrich Drepper <drepper@cygnus.com>
1887 * manager.c: Threads now send __pthread_sig_cancel on termination.
1888 Change clone call and signal masks.
1889 * thread.c (pthread_handle_sigrestart): Remove special code for
1891 (pthread_handle_sigcancel): In manager thread call
1892 __pthread_manager_sighandler.
1893 * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
1894 * sysdeps/i386/i686/pt-machine.h: Likewise.
1895 Patches by Xavier Leroy.
1897 1998-12-14 Ulrich Drepper <drepper@cygnus.com>
1899 * spinlock.c (__pthread_unlock): Don't crash if called for an
1900 untaken mutex. Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
1902 * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
1905 1998-12-13 Ulrich Drepper <drepper@cygnus.com>
1907 * Examples/ex3.c: Wait until all threads are started before
1908 searching for the number to avoid race condition on very fast
1911 1998-12-08 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1913 * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
1914 declaration since it's not needed.
1916 * sysdeps/pthread/pthread.h: Move internal functions to ...
1917 * internals.h: ...here.
1919 1998-12-02 H.J. Lu <hjl@gnu.org>
1921 * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
1922 SIGRTMIN is defined.
1923 (__pthread_sig_cancel): Likewise.
1925 1998-12-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
1927 * wrapsyscall.c: Include <sys/mman.h> for msync,
1928 <stdlib.h> for system and <termios.h> for tcdrain prototype.
1929 Correct msync declaration.
1931 1998-11-29 Roland McGrath <roland@baalperazim.frob.com>
1933 * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
1934 __libc_tsd_set): New macros for new interface.
1935 * no-tsd.c: New file, provide uninitialized defns of
1936 __libc_internal_tsd_get and __libc_internal_tsd_set.
1937 * Makefile (routines): Add no-tsd.
1939 1998-10-12 Roland McGrath <roland@baalperazim.frob.com>
1941 * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
1942 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
1943 __libc_internal_tsd_set): Move decls to ...
1944 * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
1947 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
1948 __libc_internal_tsd_set): Make these pointers to functions, not
1949 functions; remove #pragma weak decls for them.
1950 * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
1951 Define static functions and initialized pointers to them.
1953 1998-11-18 Ulrich Drepper <drepper@cygnus.com>
1955 * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
1956 (CFLAGS-specific.c): Likewise.
1957 (CFLAGS-pthread.c): Likewise.
1958 (CFLAGS-ptfork.c): Likewise.
1959 (CFLAGS-cancel.c): Likewise.
1960 * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
1961 as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
1963 * mutex.c (pthread_mutex_init): Define as strong symbol.
1964 (pthread_mutex_destroy): Likewise.
1965 (pthread_mutex_trylock): Likewise.
1966 (pthread_mutex_lock): Likewise.
1967 (pthread_mutex_unlock): Likewise.
1968 (pthread_mutexattr_init): Likewise.
1969 (pthread_mutexattr_destroy): Likewise.
1970 (pthread_once): Likewise.
1971 * ptfork.c (pthread_atfork): Likewise.
1972 * specific.c (pthread_key_create): Likewise.
1973 (pthread_setspecific): Likewise.
1974 (pthread_getspecific): Likewise.
1976 1998-11-15 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
1978 * linuxthreads.texi: Fix punctuation after xref.
1980 1998-11-10 H.J. Lu <hjl@gnu.org>
1982 * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
1983 if it is defined in <linux/limits.h>.
1985 1998-10-29 14:28 Ulrich Drepper <drepper@cygnus.com>
1987 * spinlock.h (__pthread_trylock): Define inline.
1988 (__pthread_lock): Add extra parameter to declaration. Declare
1989 using internal_function.
1990 (__pthread_unlock): Declare using internal_function.
1991 * spinlock.c (__pthread_lock): Add new parameter. Use it instead
1992 of local variable self. Avoid recomputing self. Define using
1994 (__pthread_trylock): Remove.
1995 (__pthread_unlock): Define using internal_function.
1996 * cancel.c: Adjust for __pthread_lock interface change. Use already
1997 computed self value is possible.
1998 * condvar.c: Likewise.
2000 * manager.c: Likewise.
2001 * mutex.c: Likewise.
2002 * pthread.c: Likewise.
2003 * rwlock.c: Likewise.
2004 * semaphore.c: Likewise.
2005 * signals.c: Likewise.
2007 1998-10-27 13:46 Ulrich Drepper <drepper@cygnus.com>
2009 * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
2010 __ to field names of the struct.
2011 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
2013 (pthread_attr_t): Likewise.
2014 (pthread_cond_t): Likewise.
2015 (pthread_condattr_t): Likewise.
2016 (pthread_mutex_t): Likewise.
2017 (pthread_mutexattr_t): Likewise.
2018 (pthread_rwlock_t): Likewise.
2019 (pthread_rwlockattr_t): Likewise.
2020 * attr.c: Adjust for pthread.h and pthreadtypes.h change.
2021 * cancel.c: Likewise.
2022 * condvar.c: Likewise.
2023 * manager.c: Likewise.
2024 * mutex.c: Likewise.
2025 * pthread.c: Likewise.
2026 * ptlongjmp.c: Likewise.
2027 * rwlock.c: Likewise.
2028 * spinlock.c: Likewise.
2030 1998-10-09 Ulrich Drepper <drepper@cygnus.com>
2032 * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
2035 * sysdeps/i386/i686/pt-machine.h: Remove unused inline
2038 * Makefile (libpthread-routines): Add pt-machine.
2039 * pt-machine.c: New file.
2040 * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
2041 yet defined. Use PT_EI in extern inline definitions.
2042 * sysdeps/arm/pt-machine.h: Likewise.
2043 * sysdeps/i386/pt-machine.h: Likewise.
2044 * sysdeps/i386/i686/pt-machine.h: Likewise.
2045 * sysdeps/m68k/pt-machine.h: Likewise.
2046 * sysdeps/mips/pt-machine.h: Likewise.
2047 * sysdeps/powerpc/pt-machine.h: Likewise.
2048 * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
2049 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2051 1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2053 * semaphore.h: Include <sys/types.h> so that _pthread_descr
2056 1998-09-15 David S. Miller <davem@pierdol.cobaltmicro.com>
2058 * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
2060 * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
2062 1998-09-12 14:24 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2064 * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
2067 1998-09-02 11:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2069 * signals.c (sigaction): Check that sig is less than NSIG to avoid
2070 array index overflow.
2072 1998-09-06 10:56 Ulrich Drepper <drepper@cygnus.com>
2074 * sysdeps/pthread/semaphore.h: New file.
2076 1998-09-06 09:08 Ulrich Drepper <drepper@cygnus.com>
2078 * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
2079 _LIBC_TSD_KEY_DL_ERROR.
2081 1998-08-31 Ulrich Drepper <drepper@cygnus.com>
2083 * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
2084 * sysdeps/i386/pt-machine.h: Likewise.
2085 Suggested by Roland McGrath.
2087 1998-08-28 13:58 Ulrich Drepper <drepper@cygnus.com>
2089 * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
2090 access thread data with non-constant offsets.
2091 * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
2094 * sysdeps/i386/useldt.h: Fix typo. Add THREAD_GETMEM_NC and
2095 THREAD_SETMEM_NC definitions.
2097 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
2099 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2101 1998-08-26 15:46 Ulrich Drepper <drepper@cygnus.com>
2103 * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
2104 not already defined.
2105 (struct _pthread_descr_struct): Add p_self and p_nr field.
2106 * manager.c (__pthread_handles): Define second element to point
2108 (__pthread_handles_num): Initialize to 2.
2109 (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
2110 (pthread_start_thread): Likewise.
2111 (pthread_handle_create): Start search for free slot at entry 2.
2112 Initialize new fields p_self and p_nr.
2113 Call __clone with CLONE_PTRACE if available.
2114 (pthread_free): Call FREE_THREAD_SELF if available.
2115 * pthread.c (__pthread_initial_thread): Initialize new fields.
2116 (__pthread_manager_thread): Likewise.
2117 (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
2119 * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
2120 elements of the thread descriptor.
2121 * condvar.c: Likewise.
2122 * errno.c: Likewise.
2124 * manager.c: Likewise.
2125 * pthread.c: Likewise.
2126 * ptlongjmp.c: Likewise.
2127 * semaphore.c: Likewise.
2128 * signals.c: Likewise.
2129 * specific.c: Likewise.
2130 * spinlock.c: Likewise.
2132 * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
2134 * sysdeps/i386/useldt.h: New file.
2135 * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
2137 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
2138 THREAD_SETMEM using __thread_self.
2139 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2141 1998-08-24 Geoff Keating <geoffk@ozemail.com.au>
2143 * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
2144 turned out that we didn't need to queue after all.
2146 1998-08-22 Geoff Keating <geoffk@ozemail.com.au>
2148 * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
2149 and wastes space; correct types.
2151 1998-08-08 11:18 H.J. Lu <hjl@gnu.org>
2153 * signals.c (sigaction): Handle NULL argument.
2155 1998-08-04 Ulrich Drepper <drepper@cygnus.com>
2157 * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
2160 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2162 * Makefile (linuxthreads-version): Extract correct number from
2165 1998-07-29 Xavier Leroy <Xavier.Leroy@inria.fr>
2167 * Banner: Bump version number to 0.8
2168 * FAQ.html: Many updates, in particular w.r.t. debugging.
2169 * manager.c: Support for non-default stacksize for
2170 LinuxThreads-allocated stacks;
2171 don't use guard pages for stacks with default size, rely on
2172 rlimit(RLIMIT_STACK) instead (it's cheaper).
2174 * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
2175 everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
2176 * condvar.c: Likewise.
2177 * internals.h: Likewise.
2178 * restart.h: Likewise.
2179 * signals.c: Likewise.
2180 * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
2182 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2184 * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
2185 __pthread_mutexattr_[sg]ettype. Add more weak aliases.
2186 * Versions: Put __pthread_mutexattr_settype under version
2187 GLIBC_2.0. Don't export __pthread_mutexattr_setkind_np and
2188 __pthread_mutexattr_gettype.
2190 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2192 * sysdeps/pthread/bits/libc-lock.h: Make
2193 __pthread_mutexattr_settype weak. Don't make
2194 __pthread_mutexattr_setkind_np weak.
2196 1998-07-16 10:52 Ulrich Drepper <drepper@cygnus.com>
2198 * manager.c (pthread_handle_create): Check whether sched_setscheduler
2199 call can succeed here.
2201 * mutex.c: Define __pthread_mutexattr_settype and make
2202 __pthread_mutexattr_setkind_np an alias.
2203 Likewise for __pthread_mutexattr_gettype.
2205 1998-07-15 11:00 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2207 * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
2210 1998-07-14 19:38 Ulrich Drepper <drepper@cygnus.com>
2212 * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
2214 1998-07-11 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2216 * Examples/ex6.c: Include <unistd.h> for usleep.
2218 1998-06-13 11:04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2220 * Examples/ex4.c (main): Use exit, not pthread_exit.
2222 1998-07-09 13:39 Ulrich Drepper <drepper@cygnus.com>
2224 * Versions: Add __pthread_mutexattr_gettype and
2225 __pthread_mutexattr_settype.
2226 * lockfile.c: Use __pthread_mutexattr_settype instead of
2227 __pthread_mutexattr_setkind_np.
2228 * mutex.c: Define __pthread_mutexattr_gettype and
2229 __pthread_mutexattr_settype.
2231 * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
2232 __pthread_mutexattr_settype.
2233 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
2234 Use __pthread_mutexattr_settype.
2236 1998-07-08 22:26 Ulrich Drepper <drepper@cygnus.com>
2238 * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
2239 * mutex.c: Define weak alias pthread_mutexattr_gettype and
2240 pthread_mutexattr_settype.
2241 * sysdeps/pthread/pthread.h: Declare these functions.
2242 Move pthread_sigmask and pthread_kill declaration in separate header.
2243 * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
2245 1998-07-07 15:20 Ulrich Drepper <drepper@cygnus.com>
2247 * Makefile: Add rules to compile and run tests.
2248 * Examples/ex1.c: Little changes to fix warnings.
2249 * Examples/ex2.c: Likewise.
2250 * Examples/ex3.c: Likewise.
2251 * Examples/ex4.c: Likewise.
2252 * Examples/ex5.c: Likewise.
2253 * Examples/ex6.c: New file.
2255 1998-07-05 11:54 Ulrich Drepper <drepper@cygnus.com>
2257 * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
2259 1998-07-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2261 * attr.c: Include <string.h>.
2263 1998-06-30 11:47 Ulrich Drepper <drepper@cygnus.com>
2265 * attr.c: Include errno.h. Use memcpy to copy sched_param.
2266 * internals.h: Include limits.h.
2267 * manager.c: Use memcpy to copy sched_param.
2268 * ptfork.c: Include errno.h.
2269 * pthread.c: Likewise.
2270 * semaphore.c: Likewise.
2271 * specific.c: Likewise.
2272 * spinlock.h: Likewise.
2273 * sysdeps/pthread/pthread.h: Include only allowed headers. Move
2274 type definition to ...
2275 * sysdeps/pthread/bits/pthreadtypes.h: ...here. New file.
2277 1998-06-29 12:34 Ulrich Drepper <drepper@cygnus.com>
2279 * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
2281 * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
2282 as macros as demanded in POSIX.1, Annex C.
2284 1998-06-29 12:29 Ulrich Drepper <drepper@cygnus.com>
2286 * internals.h (struct pthread_request): For free use pthread_t
2287 instead of pthread_descr.
2288 * join.c (pthread_join): Pass thread_id, not th to manager.
2289 (pthread_detach): Likewise.
2290 * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
2291 (pthread_exited): Remove detached queue code.
2292 (pthread_handle_free): Expect thread ID parameter and use it to
2293 validate the thread decsriptor. Don't use detached queue.
2294 Patches by Xavier Leroy.
2296 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2298 * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
2299 _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
2300 __pthread_atfork, __pthread_key_create, __pthread_once.
2301 * internals.h: Doc fix.
2302 * pthread.c (__pthread_initialize): Define again.
2304 1998-06-26 Ulrich Drepper <drepper@cygnus.com>
2306 * manager.c (pthread_exited): If thread is not detached put it on
2308 (pthread_handle_free): If thread is not on list with living threads
2309 search on list with detached threads.
2311 * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
2312 for new definition of pthread_rwlock_t.
2314 * spinlock.c: Correct test whether to compile
2315 __pthread_compare_and_swap or not.
2317 1998-06-25 19:27 Ulrich Drepper <drepper@cygnus.com>
2319 * attr.c: Finish user stack support. Change locking code to be safe
2320 in situations with different priorities.
2321 * cancel.c: Likewise.
2322 * condvar.c: Likewise.
2323 * internals.h: Likewise.
2325 * manager.c: Likewise.
2326 * mutex.c: Likewise.
2327 * pthread.c: Likewise.
2328 * ptlongjmp.c: Likewise.
2329 * queue.h: Likewise.
2330 * rwlock.c: Likewise.
2331 * semaphore.c: Likewise.
2332 * semaphore.h: Likewise.
2333 * signals.c: Likewise.
2334 * spinlock.c: Likewise.
2335 * spinlock.h: Likewise.
2336 * sysdeps/pthread/pthread.h: Likewise.
2337 Patches by Xavier Leroy.
2339 * sysdeps/i386/i686/pt-machine.h: New file.
2341 1998-06-25 Ulrich Drepper <drepper@cygnus.com>
2343 * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
2344 [sg]et_stackaddr prototypes always available.
2346 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2347 _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
2349 1998-06-24 Ulrich Drepper <drepper@cygnus.com>
2351 * manager.c (pthread_free): Undo patch from 980430.
2352 Reported by David Wragg <dpw@doc.ic.ac.uk>.
2354 1998-06-09 15:07 Ulrich Drepper <drepper@cygnus.com>
2356 * manager.c: Define __pthread_manager_adjust_prio and use it to
2357 increase priority when needed.
2358 * internals.h: Add prototype for __pthread_manager_adjust_prio.
2359 * mutex.c: Optimize mutexes to wake up only one thread.
2360 * pthread.c: Move PID of manager for global variable in structure
2362 Patches by Xavier Leroy.
2364 1998-06-07 13:47 Ulrich Drepper <drepper@cygnus.com>
2366 * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
2368 1998-06-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2370 * attr.c: Correct typo.
2372 1998-05-01 Ulrich Drepper <drepper@cygnus.com>
2374 * manager.c (pthread_free): Unmap guard before the stack.
2375 Patch by Matthias Urlichs.
2377 1998-04-30 Ulrich Drepper <drepper@cygnus.com>
2379 * manager.c (pthread_free): Detect already free child.
2380 Patch by Xavier Leroy, reported by Matthias Urlichs.
2382 1998-04-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2384 * Makefile (linuxthreads-version): Renamed back from
2387 1998-04-21 Ulrich Drepper <drepper@cygnus.com>
2389 * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
2392 1998-04-20 14:55 Ulrich Drepper <drepper@cygnus.com>
2394 * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
2395 * internals.h: Add definitions for new spinlock implementation.
2396 * ptlongjmp.c: New file.
2397 * spinlock.c: New file.
2398 * spinlock.h (acquire): Don't reschedule using __sched_yield, use
2399 new function __pthread_acquire to prevent deadlocks with thread
2400 with different priorities.
2401 Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
2403 1998-03-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2405 * manager.c (__pthread_manager): Reduce first argument to select
2406 to include just the needed file descriptor.
2408 1998-03-17 00:06 Ulrich Drepper <drepper@cygnus.com>
2410 * manager.c: Fix last patch which caused core dumps.
2412 * pthread.c: Correctly handle missing SIGRTMIN.
2414 1998-03-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2416 * libpthread.map: Add __libc_internal_tsd_get and
2417 __libc_internal_tsd_set. Add missing cancelable functions. Export
2418 libc internal versions of the cancelable functions.
2420 1998-03-13 16:51 Ulrich Drepper <drepper@cygnus.com>
2422 * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
2424 1998-03-13 00:46 Ulrich Drepper <drepper@cygnus.com>
2426 * attr.c: Implement pthread_attr_[gs]etguardsize,
2427 pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
2428 Change pthread_attr_init to have two interfaces.
2429 * internals.h (struct _pthread_descr_struct): Add new fields for
2431 * libpthread.map: Add names in GLIBC_2.1 section.
2432 * manager.c (pthread_handle_create): Implement guardsize and
2434 (pthread_free): Likewise.
2435 * pthread.c (pthread_create): Add new interface for changed
2437 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2438 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
2441 1998-03-11 00:42 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
2443 * manager.c: Enable resetting of the thread scheduling policy
2444 to SCHED_OTHER when the parent thread has a different one.
2446 1998-02-01 13:51 Ulrich Drepper <drepper@cygnus.com>
2448 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2449 _POSIX_ASYNCHRONOUS_IO.
2451 * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
2453 * mutex.c: Implement new mutex types.
2455 * internals.h: Include <signal.h>.
2457 * libpthread.map: Add __erno_location and __h_errno_location.
2459 * errno.c: Return pointer to variable actually in use. This might
2460 not be the one in the thread structure.
2461 * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
2463 * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
2464 of manager thread structure.
2465 (pthread_handle_create): Set p_errnop and p_h_errnop members for new
2467 * pthread.c: Adapt initializer for thread structures.
2468 (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
2469 (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
2470 current thread to global variables.
2472 1998-01-31 17:27 Ulrich Drepper <drepper@cygnus.com>
2474 * rwlock.c: New file.
2475 * Makefile (libpthread-routines): Add rwlock.
2476 * sysdeps/pthread/pthread.h: Define data structures and declare
2478 * libpthread.map: Add new functions.
2480 1997-12-18 13:50 Philip Blundell <pb@nexus.co.uk>
2482 * sysdeps/arm/pt-machine.h: New file; add ARM support.
2483 * sysdeps/arm/Implies: likewise.
2484 * README: Document it.
2486 1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2488 * signals.c: Remove unneeded initializer for sigwaited, saving a
2491 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2493 * semaphore.c (sem_init): Set sem_spinlock only if available.
2495 1997-12-04 01:48 Ulrich Drepper <drepper@cygnus.com>
2497 * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
2498 * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
2500 * Makefile: Update from LinuxThreads 0.7.
2501 * internals.h. Likewise.
2502 * manager.c: Likewise.
2503 * mutex.c: Likewise.
2504 * pthread.c: Likewise.
2505 * signals.c: Likewise.
2506 * specific.c: Likewise.
2507 * Examples/ex3.c: Likewise.
2509 1997-11-20 18:13 Ulrich Drepper <drepper@cygnus.com>
2511 * pthread.c (__pthread_reset_main_thread): Close pipe only if still
2514 1997-10-29 05:38 Ulrich Drepper <drepper@cygnus.com>
2516 * wrapsyscall.c: Add socket functions which are also cancelation
2519 1997-10-19 21:40 Wolfram Gloger <wg@wolfram.dent.med.uni-muenchen.de>
2521 * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
2522 New functions for fast thread specific data within libc.
2524 * internals.h: Add new array p_libc_specific to struct
2525 _pthread_descr_struct.
2527 * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
2529 1997-10-13 05:39 Ulrich Drepper <drepper@cygnus.com>
2531 * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
2532 Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
2534 1997-08-29 03:05 Ulrich Drepper <drepper@cygnus.com>
2536 * internals.h (struct _pthread_descr_struct): Add definitions for
2537 two-level specific key handling.
2538 * manager.c (pthread_handle_create): Initialize specific memory array.
2539 * specific.c: Implement two-level key handling.
2540 * weaks.c: Don't provide dummy key handling.
2541 * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
2542 Add definition of __libc_key_t.
2543 * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
2545 Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
2546 PTHREAD_DESTRUCTOR_ITERATIONS.
2548 * manager.c (pthread_handle_create): Compare mmap result with
2551 * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
2552 * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
2554 1997-08-22 19:04 Richard Henderson <rth@cygnus.com>
2556 sysdeps/sparc -> sysdeps/sparc/sparc32
2557 sysdeps/sparc64 -> sysdeps/sparc/sparc64
2559 * internals.h: Change definition of THREAD_SELF to be an expression,
2560 not a statement that did a return.
2561 * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
2562 * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
2563 Follow Solaris and use a "system reserved" register (%g6) to hold
2564 the thread descriptor.
2565 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2567 1997-08-03 00:09 Ulrich Drepper <drepper@cygnus.com>
2569 * mutex.c: Correct pthread_once. Patch by Xavier Leroy.
2570 * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
2571 * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
2573 * semaphore.c: Include spinlock.h only when needed.
2575 * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
2576 keys for entries not in use.
2578 * weaks.c: Implement key handling functions for real.
2580 1997-06-29 01:04 Richard Henderson <richard@gnu.ai.mit.edu>
2582 Initial sparc64-linux support:
2583 * sysdeps/sparc64/Implies: New file.
2584 * sysdeps/sparc64/pt-machine.h: Likewise.
2586 1997-06-29 00:48 Ulrich Drepper <drepper@cygnus.com>
2588 * semaphore.c: Include spinlock.h at correct place.
2591 1997-06-13 10:06 Richard Henderson <rth@tamu.edu>
2593 The Great Bit File Move:
2594 * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
2595 * sysdeps/powerpc/semaphorebits.h: Likewise.
2596 * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
2597 * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
2598 * sysdeps/pthread/libc-lock.h: -> bits/
2599 * sysdeps/pthread/stdio-lock.h: Likewise.
2600 * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
2601 * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
2602 * semaphore.h: Likewise.
2603 * sysdeps/pthread/pthread.h: Likewise.
2605 * lockfile.c: <foo.h> -> <bits/foo.h>.
2606 * semaphore.h: Likewise.
2608 * Makefile: (headers): foo.h -> bits/foo.h.
2609 * sysdeps/pthread/Makefile: Likewise.
2611 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2613 * semaphore.c (sem_init): Set sem_spinlock only if available.
2615 * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
2618 1997-04-09 03:00 Ulrich Drepper <drepper@cygnus.com>
2620 Update from LinuxThreads 0.6.
2622 * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
2623 and __sched_get_priority_min instead of names without `__'.
2625 * manager.c: Rewrite large parts to implement opaque pthread_t.
2627 * cancel.c: Adapt for opaque pthread_t type.
2628 * condvar.c: Likewise.
2629 * errno.c: Likewise.
2631 * mutex.c: Likewise.
2632 * pthread.c: Likewise.
2633 * signals.c: Likewise.
2634 * specific.c: Likewise.
2635 * restart.h: Likewise.
2636 * queue.h: Likewise.
2637 * Examples/ex3.c: Likewise.
2638 * Examples/ex4.c: Likewise.
2639 * sysdeps/pthread/pthread.h: Likewise.
2641 * pthread.c: Accumulate time for all threads in thread manager.
2643 * semaphore.c: Implement fallback implementation for architectures
2644 sometimes missing compare-exchange operations.
2646 * cancel.c (pthread_cancel): Validate handle argument.
2647 * join.c (pthread_join): Likewise.
2648 (pthread_detach): Likewise.
2649 * signals.c (pthread_kill): Likewise.
2651 * spinlock.h (acquire): Use __sched_yield not sched_yield.
2653 * queue.h (enqueue): Enqueue thread according to priority.
2655 * internals.c (struct pthread_start_args): New struct for passing
2656 args to cloning function.
2657 (struct _pthread): Rename to _pthread_descr_struct and adapt for
2660 * Examples/Makefile (clean): Pass -f option to rm.
2662 * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
2663 and define TEST_FOR_COMPARE_AND_SWAP.
2664 * sysdeps/i386/i486/pt-machine.h: Removed.
2666 * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
2669 1997-04-04 16:38 Ulrich Drepper <drepper@cygnus.com>
2671 * restart.h (suspend): Clear p_signal before suspending.
2672 (suspend_with_cancellation): Likewise.
2673 Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
2675 * weaks.c: Make __pthread_key_create return 1.
2676 * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
2677 __libc_getspecific, __libc_setspecific, and __libc_key_t.
2678 * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
2681 1997-03-19 15:13 Miguel de Icaza <miguel@nuclecu.unam.mx>
2683 * sysdeps/sparc/pt-machine (RELEASE): Fix.
2685 1997-03-01 07:55 Geoff Keating <geoffk@ozemail.com.au>
2687 * sysdeps/powerpc/Implies: Added.
2688 * sysdeps/powerpc/pt-machine.h: Added.
2689 * sysdeps/powerpc/semaphorebits.h: Added.
2691 1997-01-22 01:22 Ulrich Drepper <drepper@cygnus.com>
2693 * pthread.c (__pthread_initial_thread): Correct
2695 (__pthread_manager_thread): Likewise.
2696 Reported by Andreas Jaeger.
2698 1997-01-18 22:15 Richard Henderson <rth@tamu.edu>
2700 Since sigset_t no longer fits in a register, we can't pass in the
2701 thread's initial mask so easily. Take this opportunity to simplify
2702 the clone implementation by only accepting a single void* argument.
2704 * manager.c (__pthread_manager): Put thread vitals in the thread
2705 struct instead of as arguments through clone.
2706 (pthread_start_thread): Look for them there.
2707 * internals.h (struct _pthread): Add p_initial_fn,
2708 p_initial_fn_arg, p_initial_mask. Fix __pthread_manager proto.
2709 * pthread.c (pthread_initialize_manager): Revise clone invocation.