1 2001-07-16 Andreas Schwab <schwab@suse.de>
3 * Makefile (before-compile): Don't add $(objpfx)crti.o.
5 ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
6 it is filtered out of the link command.
8 2001-07-16 Ulrich Drepper <drepper@redhat.com>
10 * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
11 to find the right value for __pthread_initial_thread_bos, it's not
12 used. If not FLOATING_STACKS first run
13 __pthread_init_max_stacksize.
15 2001-06-16 H.J. Lu <hjl@gnu.org>
17 * internals.h: Include <stackinfo.h>.
19 * attr.c: Don't include <stackinfo.h> here.
21 * manager.c: Likewise.
22 * pthread.c: Likewise.
23 * ptlongjmp.c: Likewise.
25 2001-03-23 Matthew Wilcox <willy@ldl.fc.hp.com>
27 * attr.c: Make _STACK_GROWS_UP work.
28 * internals.h: Likewise.
29 * manager.c: Likewise.
30 * pthread.c: Likewise.
32 2001-06-15 H.J. Lu <hjl@gnu.org>
34 * pthread.c (__pthread_reset_main_thread): Fix a typo.
36 2001-02-02 John S. Marvin <jsm@udlkern.fc.hp.com>
38 * semaphore.h: Use struct _pthread_fastlock as an element of
39 sem_t instead of an identical struct.
40 * rwlock.c: Remove casts.
41 * semaphore.c: Likewise.
43 2001-04-30 Alan Modra <amodra@one.net.au>
45 * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
47 2001-05-25 Bruce Mitchener <bruce@cubik.org>
49 * linuxthreads.texi: Spelling corrections.
51 2001-05-25 Ulrich Drepper <drepper@redhat.com>
53 * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
54 returning successfully.
55 Patch by Gene Cooperman <gene@ccs.neu.edu>.
57 2001-05-24 Ulrich Drepper <drepper@redhat.com>
59 * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
60 serious work try once whether the lock is uncontested.
61 Remove duplicate reading of __status before loop.
62 Change suggested by Hans Boehm <hans_boehm@hp.com>.
64 * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
65 (__pthread_alt_trylock): Likewise.
67 2001-05-01 Kaz Kylheku <kaz@ashi.footprints.net>
69 Memory barrier overhaul following line by line inspection.
70 * mutex.c (pthread_once): Missing memory barriers added.
71 * pthread.c (__pthread_wait_for_restart_signal,
72 __pthread_timedsuspend_new, __pthread_restart_new): Added
73 memory barriers ``just in case'' and for documentary value.
74 * spinlock.c (__pthread_release): New inline function for releasing
75 spinlock, to complement __pthread_acquire. Includes memory
76 barrier prior to assignment to spinlock, and __asm __volatile
77 dance to prevent reordering or optimization of the spinlock access.
78 * spinlock.c (__pthread_unlock, __pthread_alt_lock,
79 __pthread_alt_timedlock, __pthread_alt_unlock,
80 __pthread_compare_and_swap): Updated to use new __pthread_release
81 instead of updating spinlock directly.
82 * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
83 wait_node_free, wait_node_dequeue, __pthread_alt_lock,
84 __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
85 Memory barrier overhaul. Lots of missing memory barriers added,
86 a couple needless ones removed.
87 * spinlock.c (__pthread_compare_and_swap): testandset optimization
88 removed, just calls __pthread_acquire, which has the new read
89 barrier in it before its testandset.
91 2001-05-20 Roland McGrath <roland@frob.com>
93 * Makeconfig: New file, variables used to be in main libc Makeconfig.
95 2001-05-09 Geoff Keating <geoffk@redhat.com>
97 * sysdeps/powerpc/pt-machine.h
98 (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
99 (__compare_and_swap): Remove memory barriers.
100 (__compare_and_swap_with_release_semantics): New function.
102 2001-04-24 Andreas Jaeger <aj@suse.de>
104 * wrapsyscall.c: send* and recv* return ssize_t.
106 * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
107 mutex instead of double locking it.
108 Reported by Pierre Artaud <partaud@sodatec.com>.
110 2001-04-23 Ulrich Drepper <drepper@redhat.com>
112 * sysdeps/pthread/getcpuclockid.c: Make function generic, test
113 using #ifdef whether the clock is available.
114 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
116 * sysdeps/ia64/Versions: New file.
118 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
119 have to call __gmon_start__ in the libpthread DSO.
120 * sysdeps/pthread/pt-initfini.c (_init): Likewise.
122 * Makefile (libpthread-routines): Add ptclock_gettime and
124 * internals.h: Don't use cpuclock-init.h definitions, use
125 hp-timing.h definitions.
126 * pthread.c: Likewise.
127 * manager.c: Likewise.
128 * ptclock_gettime.c: New file.
129 * ptclock_settime.c: New file.
130 * internals.h: Fix parameter type for __pthread_clock_gettime and
131 __pthread_clock_settime.
133 * sysdeps/i386/i586/ptclock_gettime.c: Removed.
134 * sysdeps/i386/i586/ptclock_settime.c: Removed.
135 * sysdeps/i386/i586/Makefile: Removed.
137 2001-04-22 Ulrich Drepper <drepper@redhat.com>
139 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
140 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
142 2001-04-21 Andreas Jaeger <aj@suse.de>
144 * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
145 attribute, remove statements that will never be executed.
146 (thread_func): Remove mutex_unlock call since it's never executed.
147 (thread_func): Fix comment as suggested by Jakub Jelinek.
149 * manager.c (__pthread_manager): Add noreturn
151 (pthread_start_thread): Likewise, remove return statement.
152 (pthread_start_thread_event): Likewise.
153 Add noreturn attribute for pthread_handle_exit.
154 * weaks.c: Add noreturn attribute for pthread_exit.
156 * internals.h: Add __pthread_clock_gettime and
157 __pthread_clock_settime prototypes.
159 2001-04-21 Ulrich Drepper <drepper@redhat.com>
161 * internals.h: Include <cpuclock-init.h>.
162 (struct _pthread_descr_struct): Add p_cpuclock_offset field if
163 CPUCLOCK_VARDEF is defined.
164 * pthread.c (__pthread_initialize_minimal): Initialize
165 p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
166 * manager.c (pthread_start_thread): Set p_cpuclock_offset field
167 for new thread to current CPU clock value.
169 * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
171 * sysdeps/i386/i586/Makefile: New file.
172 * sysdeps/i386/i586/Versions: New file.
173 * sysdeps/i386/i586/ptclock_gettime.c: New file.
174 * sysdeps/i386/i586/ptclock_settime.c: New file.
175 * sysdeps/i386/i686/Implies: New file.
177 2001-04-18 Jakub Jelinek <jakub@redhat.com>
179 * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
180 $generated, not $postclean-generated.
182 2001-04-18 Andreas Jaeger <aj@suse.de>
184 * Makefile (otherlibs): Added.
186 2001-04-18 Jakub Jelinek <jakub@redhat.com>
188 * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
190 2001-04-16 Ulrich Drepper <drepper@redhat.com>
192 * signals.c (sigwait): NSIG is no signal number. Block all
193 signals while in signal handler for signals in SET.
194 Patch by Manfred Spraul <manfred@colorfullife.com>.
196 2001-04-12 Ulrich Drepper <drepper@redhat.com>
198 * tst-cancel.c: Disable most tests. Add new test where all
199 cleanup handlers must run.
200 * Makefile (tests): Add tst-cancel again.
202 * cancel.c (__pthread_perform_cleanup): Correct condition for
203 leaving cleanup loop early.
205 * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
206 all the files which use CURRENT_STACK_FRAME.
207 * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
208 __builtin_frame_address.
209 * sysdeps/i386/i686/pt-machine.h: Likewise.
211 2001-04-11 Ulrich Drepper <drepper@redhat.com>
213 * Makefile (tests): Comment out tst-cancel for now.
215 * tst-cancel.c (main): Cleanup 4 is supposed to run. Create
216 temporary file in object directory.
217 * Makefile: Don't allow inlining when compiling tst-cancel.c.
218 Pass $(objpfx) to tst-cancel.
220 2001-04-11 David S. Miller <davem@redhat.com>
222 * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
223 up closer to user local variables so that new cleanup heuristics work.
224 * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
226 2001-04-11 Ulrich Drepper <drepper@redhat.com>
228 * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
230 (_pthread_cleanup_push_defer): Likewise.
232 * tst-cancel.c (main): Fix loop printing cleanup output.
234 2001-04-10 kaz Kojima <kkojima@rr.iij4u.or.jp>
236 * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
238 (__pthread_spin_trylock): Likewise.
239 * sysdeps/sh/pt-machine.h (testandset): Likewise.
241 2001-04-10 Ulrich Drepper <drepper@redhat.com>
243 * join.c (pthread_exit): Move code to new function __pthread_do_exit
244 which takes an extra parameter with the current frame pointer.
245 Call new function with CURRENT_STACK_FRAME.
246 (__pthread_do_exit): New function. Call __pthread_perform_cleanup
247 with the new parameter.
248 (pthread_join): Call __pthread_do_exit instead of pthread_exit.
249 * cancel.c (__pthread_perform_cleanup): Takes extra parameter. Use
250 this parameter as the initial value the cleanup handler records are
251 compared against. No active cleanup handler record must have an
252 address lower than the previous one and the initial record must be
253 above (below on PA) the frame address passed in.
254 (pthread_setcancelstate): Call __pthread_do_exit instead of
256 (pthread_setcanceltype): Likewise.
257 (pthread_testcancel): Likewise.
258 (_pthread_cleanup_pop_restore): Likewise.
259 * condvar.c (pthread_cond_wait): Likewise.
260 (pthread_cond_timedwait_relative): Likewise.
261 * manager.c (pthread_start_thread): Likewise.
262 * oldsemaphore.c (__old_sem_wait): Likewise.
263 * pthread.c (pthread_handle_sigcancel): Likewise.
264 * semaphore.c (__new_sem_wait): Likewise.
265 (sem_timedwait): Likewise.
266 * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
267 to limit the cleanup handlers which get run.
268 * internals.h: Add prototype for __pthread_do_exit. Adjust prototype
269 for __pthread_perform_cleanup.
271 * Makefile (tests): Add tst-cancel.
272 * tst-cancel.c: New file.
274 2001-04-08 Hans-Peter Nilsson <hp@axis.com>
276 * sysdeps/cris/pt-machine.h: New file.
277 * sysdeps/cris/pspinlock.c: New file.
279 2001-04-09 Hans-Peter Nilsson <hp@axis.com>
281 * shlib-versions: Add case for Linux on CRIS.
283 2001-03-26 Ulrich Drepper <drepper@redhat.com>
285 * attr.c (pthread_getattr_np): Correct computation of stack size
286 for machiens with register stack.
288 * Examples/ex17.c (main): Correct detection of failed mmap call.
290 2001-03-21 Jakub Jelinek <jakub@redhat.com>
292 * pthread.c (__pthread_initialize_manager): Fix a typo.
294 2001-03-21 Jakub Jelinek <jakub@redhat.com>
296 * attr.c (__pthread_attr_setstack): Fix alignment check.
297 (pthread_getattr_np): __stackaddr is top of stack, not bottom.
298 * Makefile (tests): Add ex17 test.
299 * Examples/ex17.c: New test.
301 2001-03-20 Ulrich Drepper <drepper@redhat.com>
303 * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
304 * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
305 * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
307 2001-03-18 Ulrich Drepper <drepper@redhat.com>
309 * Makefile: When generating DSO link with libc_nonshared.a.
311 2001-02-26 Jakub Jelinek <jakub@redhat.com>
313 * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
315 2001-02-23 Jakub Jelinek <jakub@redhat.com>
317 * internals.h (__pthread_init_max_stacksize): New prototype.
318 * attr.c (__pthread_attr_setstacksize): Call
319 __pthread_init_max_stacksize if not yet initialized.
320 * pthread.c (__pthread_init_max_stacksize): New function.
321 (__pthread_initialize_manager): Call it.
322 Patch by <dtc@cmucl.cons.org>.
324 2001-03-16 Ulrich Drepper <drepper@redhat.com>
326 * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
328 2001-03-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
330 * shlib-versions: Add rule for Linux on 64 bit S/390.
331 * sysdeps/s390/s390-64/pt-machine.h: New file.
332 * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
334 2001-03-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
336 * sysdeps/s390/pt-machine.h: Move to...
337 * sysdeps/s390/s390-32/pt-machine.h: ...here.
338 Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
340 2001-03-15 Ulrich Drepper <drepper@redhat.com>
342 * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
343 * attr.c: Implement pthread_getattr_np.
344 * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
345 * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
346 * manager.c (pthread_handle_create): Initialize p_inheritsched.
348 2001-03-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
350 * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
353 2001-02-20 Hans Boehm <hans_boehm@hp.com>
355 * manager.c (manager_mask): Removed static vesion. Now always local
356 to __pthread_manager().
357 (manager_mask_all): Removed completely.
358 (__pthread_manager): Remove manager_mask_all initialization.
359 (pthread_handle_create): Remove code to set and reset signal mask
360 around __clone2() calls.
362 2001-02-17 Jakub Jelinek <jakub@redhat.com>
364 * spinlock.c (__pthread_lock): Force lock->__status to be read from
365 memory on every spin.
367 2001-02-10 Andreas Jaeger <aj@suse.de>
369 * Makefile (extra-objs): New.
371 2001-02-09 Jakub Jelinek <jakub@redhat.com>
373 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
374 __pthread_initialize_minimal prototype.
376 2001-02-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
378 * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
380 2001-02-06 Martin Schwidefsky <schwidefsky@de.ibm.com>
382 * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
384 2001-02-06 Ulrich Drepper <drepper@redhat.com>
386 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
387 broken code. Patch by Jes Sorensen.
389 2001-02-06 Andreas Jaeger <aj@suse.de>
391 * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
393 * internals.h: ...here.
395 2001-02-05 Jes Sorensen <jes@linuxcare.com>
397 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
399 2001-02-02 Ulrich Drepper <drepper@redhat.com>
401 * Versions: Remove __pthread_initialize_minimal.
403 2001-02-01 Ulrich Drepper <drepper@redhat.com>
405 * Makefile: Add rules to build crti.o and make it being used in
406 building libpthread.so.
407 * sysdeps/i386/Makefile: New file.
408 * sysdeps/pthread/pt-initfini.c: New file.
410 * pthread.c: Cleanups.
412 2001-01-28 Andreas Jaeger <aj@suse.de>
414 * oldsemaphore.c (__old_sem_init): Adjust for last change.
415 * sysdeps/pthread/bits/libc-lock.h: Likewise.
416 * spinlock.c: Likewise.
418 2001-01-28 Ulrich Drepper <drepper@redhat.com>
420 * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
421 * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
422 * manager.c: Adjust for namespace cleanup in bits/initspin.h.
423 * pthread.c: Likewise.
424 * spinlock.h: Likewise.
425 * sysdeps/pthread/pthread.h: Likewise.
427 2001-01-26 Ulrich Drepper <drepper@redhat.com>
429 * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
430 as struct __pthread_attr_s.
432 * semaphore.h (sem_t): Cleanup namespace, rename status and
435 2001-01-13 Jakub Jelinek <jakub@redhat.com>
437 * pthread.c (pthread_onexit_process): Clear
438 __pthread_manager_thread_bos after freeing it.
439 * Makefile (tests): Add ex16.
440 * Examples/ex16.c: New file.
442 2001-01-11 Jakub Jelinek <jakub@redhat.com>
444 * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
446 * pthread.c (pthread_exit_process): Rename to...
447 (pthread_onexit_process): ...this.
448 (pthread_atexit_process, pthread_atexit_retcode): New.
449 (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
450 and only if HAVE_Z_NODELETE is not defined.
451 (__pthread_initialize_manager): Register pthread_atexit_retcode
454 2001-01-11 Ulrich Drepper <drepper@redhat.com>
456 * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
458 2001-01-11 Jakub Jelinek <jakub@redhat.com>
460 * Makefile (tests): Add ex15.
461 * Examples/ex15.c: New test.
463 2001-01-08 Ulrich Drepper <drepper@redhat.com>
465 * pthread.c (pthread_exit_process): Free memory allocated for
468 2000-12-31 Ulrich Drepper <drepper@redhat.com>
470 * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
471 (pthread_free): Always unmap the stack. It's safe now that we don't
472 use MAP_FIXED to allocate stacks.
474 2000-12-31 Ulrich Drepper <drepper@redhat.com>
476 * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
478 * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
480 2000-11-15 Wolfram Gloger <wg@malloc.de>
482 * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
483 stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
485 2000-12-27 Andreas Jaeger <aj@suse.de>
487 * Examples/ex13.c: Make local functions static.
488 * ecmutex.c: Likewise.
489 * joinrace.c: Likewise.
490 * Examples/ex14.c: Likewise.
492 * Examples/ex2.c: Make local functions static; reformat.
493 * Examples/ex1.c: Likewise.
494 * Examples/ex4.c: Likewise.
495 * Examples/ex5.c: Likewise.
496 * Examples/ex7.c: Likewise.
498 * oldsemaphore.c: Add prototypes to shut up GCC.
499 * pt-machine.c: Likewise.
501 * weaks.c: Add prototype for pthread_exit.
503 * internals.h: Add some prototypes, format prototypes and add
505 Move __libc_waitpid prototype to include/sys/wait.h.
507 * rwlock.c: Include <bits/libc-lock.h> for prototypes.
509 * specific.c: Likewise.
510 * ptfork.c: Likewise.
512 * lockfile.c: Include internals.h to get prototypes.
513 * events.c: Likewise.
514 * sysdeps/alpha/pspinlock.c: Likewise.
515 * sysdeps/arm/pspinlock.c: Likewise.
516 * sysdeps/hppa/pspinlock.c: Likewise.
517 * sysdeps/i386/pspinlock.c: Likewise.
518 * sysdeps/ia64/pspinlock.c: Likewise.
519 * sysdeps/m68k/pspinlock.c: Likewise.
520 * sysdeps/mips/pspinlock.c: Likewise.
521 * sysdeps/powerpc/pspinlock.c: Likewise.
522 * sysdeps/s390/pspinlock.c: Likewise.
523 * sysdeps/sh/pspinlock.c: Likewise.
524 * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
525 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
526 * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
528 2000-12-27 Ulrich Drepper <drepper@redhat.com>
530 * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
531 (__pthread_attr_getstack): Return correct address.
532 Add warnings for using pthread_attr_getstackaddr and
533 pthread_attr_setstackaddr.
535 2000-12-26 Ulrich Drepper <drepper@redhat.com>
537 * Examples/ex6.c (test_thread): Make static.
538 * Examples/ex12.c (test_thread): Make static and add noreturn
541 2000-12-18 Jes Sorensen <jes@linuxcare.com>
543 * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
544 and compare_and_swap_with_release_semantics returns int not long.
546 2000-12-17 Andreas Jaeger <aj@suse.de>
548 * sysdeps/s390/pt-machine.h (testandset): Use long int as return
550 * sysdeps/arm/pt-machine.h (testandset): Likewise.
551 * sysdeps/hppa/pt-machine.h (testandset): Likewise.
552 * sysdeps/m68k/pt-machine.h (testandset): Likewise.
553 * sysdeps/sh/pt-machine.h (testandset): Likewise.
554 * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
555 * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
557 2000-12-17 Ulrich Drepper <drepper@redhat.com>
559 * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
560 * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
562 2000-12-17 Andreas Jaeger <aj@suse.de>
564 * internals.h: Add prototypes for testandset and
565 __compare_and_swap to shut up gcc warnings.
567 2000-12-06 Wolfram Gloger <wg@malloc.de>
569 * join.c (pthread_detach): Allow case where the thread has already
572 2000-12-05 Andreas Jaeger <aj@suse.de>
574 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
575 * sysdeps/mips/pt-machine.h (testandset): Likewise.
576 (__compare_and_swap): Likewise.
577 Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
579 2000-11-20 Jakub Jelinek <jakub@redhat.com>
581 * Examples/ex3.c (main): Cast int to long before casting to void *.
582 (search): Cast void * to long, not int.
583 * Examples/ex8.c (main, thread): Similarly.
584 * Examples/ex11.c (main): Similarly.
585 * Examples/ex14.c (worker, do_test): Similarly.
586 * ecmutex.c (worker, do_test): Similarly.
587 (nlocks): Cast to int.
589 2000-11-08 Bruce Mitchener <bruce@cubik.org>
591 * linuxthreads.texi: Add documentation for pthreads attributes
592 guardsize, stackaddr, stacksize, and stack. Fix typo in previous
593 patch. Document pthread_[sg]etconcurrency(). Mark
594 pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
596 2000-11-07 Ulrich Drepper <drepper@redhat.com>
598 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
600 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
601 Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
603 2000-11-06 Ulrich Drepper <drepper@redhat.com>
605 * cancel.c (pthread_cancel): Always set p_canceled, even if we are
606 not doing it right now.
607 Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
609 2000-10-30 Ulrich Drepper <drepper@redhat.com>
611 * Examples/ex4.c (main): Don't use exit() to avoid warning with
614 2000-10-29 Ulrich Drepper <drepper@redhat.com>
616 * attr.c (__pthread_attr_setguardsize): Don't round guardsize
617 here. Reported by Bruce Mitchener <bruce@cubik.org>.
619 * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
620 discussing mutexes. (As per the Unix98 name for the API.)
621 Changes documentation for pthread_mutexattr_setkind_np() and
622 pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
623 same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
624 Changes references to PTHREAD_MUTEXATTR_FAST_NP to
625 PTHREAD_MUTEXATTR_ADAPTIVE_NP.
626 Begins to introduce discussion of the ``timed'' mutex type. This
627 discussion is currently incomplete.
628 Patch by Bruce Mitchener <bruce@cubik.org>.
630 2000-10-26 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
631 Yutaka Niibe <gniibe@chroot.org>
633 * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
634 has restrictions, use register.
636 2000-10-23 Andreas Schwab <schwab@suse.de>
638 * Examples/ex14.c (TIMEOUT): Override default timeout.
640 2000-10-16 Ulrich Drepper <drepper@redhat.com>
642 * specific.c: Protect tsd array modification in thread data
643 structures by getting the thread lock in pthread_key_delete and
644 __pthread_destroy_specifics.
645 Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
647 2000-10-12 Alan Modra <alan@linuxcare.com.au>
649 * sysdeps/pthread/bits/initspin.h: New file.
650 * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
651 (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
652 (__pthread_alt_init_lock): Likewise.
653 (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
655 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
657 * oldsemaphore.c (__old_sem_init): Release lock with
658 LT_SPINLOCK_INIT, not zero.
659 * spinlock.c (__pthread_unlock): Likewise.
660 (__pthread_alt_lock): Likewise.
661 (__pthread_alt_timedlock): Likewise.
662 (__pthread_alt_unlock): Likewise.
663 * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
664 LT_SPINLOCK_INIT if it is non-zero. Likewise for init-once flags.
665 * sysdeps/pthread/pthread.h: Include bits/initspin.h. Use
666 LT_SPINLOCK_INIT do initialize spinlocks not 0.
668 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
670 * shlib-versions: Add version definitions for hppa-linux.
672 2000-10-12 Alan Modra <alan@linuxcare.com.au>
674 * sysdeps/hppa/pspinlock.c: New file.
675 * sysdeps/hppa/pt-machine.h: New file.
676 * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
678 2000-10-05 Jakub Jelinek <jakub@redhat.com>
680 * mutex.c (__pthread_mutex_destroy): Correct test of
681 busy mutex for mutexes using alternate fastlocks.
682 Patch by dtc@cmucl.cons.org.
684 2000-09-28 Martin Schwidefsksy <schwidefsky@de.ibm.com>
686 * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
688 2000-09-28 Ulrich Drepper <drepper@redhat.com>
690 * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
691 test for owner first.
692 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
694 * cancel.c (pthread_cancel): Don't do anything if cancelation is
697 2000-09-26 Ulrich Drepper <drepper@redhat.com>
699 * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
700 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
702 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
703 _POSIX_MONOTONIC_CLOCK.
705 * spinlock.h (__pthread_set_own_extricate_if): Add back locking
708 2000-09-20 Andreas Jaeger <aj@suse.de>
710 * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
711 "testrtsig.h" conditional.
713 2000-09-11 Ulrich Drepper <drepper@redhat.com>
715 * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
716 pthread_attr_setstack.
717 * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
718 pthread_attr_setstack.
719 * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
721 2000-09-05 Ulrich Drepper <drepper@redhat.com>
723 * Examples/ex14.c: New file.
724 * Makefile (tests): Add ex14.
726 * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
727 mutex. Patch by dtc@cmucl.cons.org.
729 * ecmutex.c: New file.
730 * Makefile (tests): Add ecmutex.
732 2000-09-04 H.J. Lu <hjl@gnu.org>
734 * attr.c (__pthread_attr_setguardsize): Use page_roundup
735 instead of roundup to round up to the page size.
737 2000-09-03 Mark Kettenis <kettenis@gnu.org>
739 * manager.c (pthread_exited): Correctly report event as TD_REAP
740 instead of TD_DEATH. Fix comments.
742 2000-09-03 Ulrich Drepper <drepper@redhat.com>
744 * spinlock.h (testandset): Add cast to avoid warning.
745 Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
747 2000-09-02 Andreas Jaeger <aj@suse.de>
749 * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
752 2000-09-01 Ulrich Drepper <drepper@redhat.com>
754 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
755 Fix typo in last patch (_mode -> _flags).
757 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
758 Provide definition which respects _IO_USER_LOCK flag.
760 2000-08-30 Ulrich Drepper <drepper@redhat.com>
762 * manager.c (pthread_allocate_stack): Clear descriptor only if not
765 2000-08-25 Ulrich Drepper <drepper@redhat.com>
767 * Makefile: Add rules to build and run unload.
768 * unload.c: New file.
770 * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
772 * sysdeps/pthread/pthread.h
773 (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
774 (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
776 2000-08-24 Andreas Jaeger <aj@suse.de>
778 * Examples/ex13.c: Include <string.h> for strerror prototype and
779 <stdlib.h> for abort prototype.
780 (pthr_cond_signal_mutex): Rewrite to silence GCC.
781 (thread_start): Remove unused variable err.
782 (main): Silence GCC warnings.
784 2000-08-22 Andreas Jaeger <aj@suse.de>
786 * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
788 * Makefile (tests): Add ex13.
790 2000-08-20 Ulrich Drepper <drepper@redhat.com>
792 * semaphore.h: Add restrict where required by AGd4.
793 * sysdeps/pthread/pthread.h: Likewise.
794 * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
796 2000-08-15 Ulrich Drepper <drepper@redhat.com>
798 * Makefile (tests): Add ex12. Add rule to build it.
799 * Examples/ex12.c: New file.
801 2000-08-13 Ulrich Drepper <drepper@redhat.com>
803 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
804 even though the implementation is not quite complete (but it reports
805 it). Define _POSIX_MESSAGE_PASSING to -1.
806 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
808 2000-08-12 Andreas Jaeger <aj@suse.de>
810 * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
812 (__compare_and_swap): Likewise.
813 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
815 2000-08-10 Ulrich Drepper <drepper@redhat.com>
817 * pthread.c (__pthread_initial_thread): Initialize p_errnop and
818 p_h_errnop correctly and not to NULL.
820 2000-08-05 Ulrich Drepper <drepper@redhat.com>
822 * Banner: Bump version number to 0.9.
824 2000-08-04 Ulrich Drepper <drepper@redhat.com>
826 * Makefile (tests): Add tststack. Add rule to build the program.
827 * tststack.c: New file.
829 * internals.h: Declare __pthread_max_stacksize.
830 * pthread.c (__pthread_max_stacksize): New variable.
831 (__pthread_initialize_manager): Determine __pthread_initialize_manager
833 * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
834 (pthread_allocate_stack): Allow kernel to choose stack address if
835 FLOATING_STACKS. This also handles variable-sized stacks.
836 Always allocate stack and guardpage together. Use mprotect to
837 change guardpage access.
838 * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
841 * attr.c (__pthread_attr_setstacksize): Also test value against
844 * manager.c (__pthread_nonstandard_stacks): Define only if
845 THREAD_SELF is not defined.
846 (pthread_allocate_stack): Always initialize gardaddr to a correct
848 (pthread_handle_create): Unmap thread with one call.
849 (pthread_free): Remove test for initial thread before removing stack.
850 Unmap stack with one call.
852 * pthread.c (__pthread_initial_thread): Initialize p_userstack to
853 1 to avoid removing the stack.
855 2000-07-27 Jes Sorensen <jes@linuxcare.com>
857 * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
858 load of spin lock to prime the cache before the atomic compare and
859 exchange operation (cmpxchg4). This avoids the spinning on the
860 cmpxchg4 instruction and reduces movement of the cache line back
861 and forth between the processors (explanation by Asis K. Mallick
862 from Intel). This basically makes the implementation operate the
863 same as the Linux kernel implementation.
865 * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
866 * sysdeps/ia64/pspinlock.c: New file.
868 2000-08-03 Ulrich Drepper <drepper@redhat.com>
870 * pthread.c: Move definition of __pthread_set_own_extricate_if...
871 * spinlock.h: ...here. Remove locking.
872 * internals.h: Remove __pthread_set_own_extricate_if prototype.
874 * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
875 (rwlock_rd_extricate_func): Don't determine self, let
876 __pthread_lock do it.
877 (rwlock_wr_extricate_func): Likewise.
878 (rwlock_have_already): Optimize *pself handling a bit.
880 * mutex.c: Use __builtin_expect.
881 * pthread.c: Likewise.
883 2000-08-02 Andreas Jaeger <aj@suse.de>
885 * sysdeps/s390/pspinlock.c: New file.
886 * sysdeps/s390/pt-machine.h: New file.
887 Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
889 2000-07-12 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
891 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
893 * sysdeps/mips/pt-machine.h (testandset): Likewise.
895 2000-07-26 Andreas Jaeger <aj@suse.de>
897 * pthread.c: Initialize p_sem_avail.
899 2000-07-25 Ulrich Drepper <drepper@redhat.com>
901 * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
902 * semaphore.c: Handle spurious wakeups.
904 * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
905 for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
907 * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
908 (__pthread_wait_for_restart): Likewise.
910 * condvar.c (pthread_cond_wait): Also check whether thread is
911 cancelable before aborting loop.
912 (pthread_cond_timedwait): Likewise.
914 * signals.c (pthread_sighandler): Remove special code to restrore
916 (pthread_sighandler_t): Likewise.
918 2000-07-25 Mark Kettenis <kettenis@gnu.org>
920 * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
921 * pthread.c: Include <resolv.h>.
922 (_res): Undefine. Add extern declaration.
924 2000-07-24 Ulrich Drepper <drepper@redhat.com>
926 * pthread.c (__pthread_initial_thread): Update initializer.
927 (__pthread_manager_thread): Likewise.
928 (pthread_initialize): Move setrlimit call to...
929 (__pthread_initialize_manager): ...here.
930 (__pthread_reset_main_thread): Reset also soft limit on stack size.
932 * condvar.c: Handle spurious wakeups. [PR libc/1749].
933 * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
935 2000-07-21 Ulrich Drepper <drepper@redhat.com>
937 * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
938 __compare_and_swap to define testandset.
939 * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
940 Define IMPLEMENT_TAS_WITH_CAS.
942 2000-07-20 Ulrich Drepper <drepper@redhat.com>
944 * Makefile: Pass -z nodelete to linker for libpthread.so
945 generation if it understand this option.
947 2000-07-18 Mark Kettenis <kettenis@gnu.org>
949 * manager.c (pthread_handle_create): Remove initialization of
950 new_thread->p_res._sock.
952 2000-07-19 Kaz Kylheku <kaz@ashi.footprints.net>
954 Bugfixes to the variant of the code for machines with no compare
957 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
958 node was not being properly enqueued, due to failing to update
959 the lock->__status field.
961 * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
962 being set inappropriately, causing the suspend function to be called
963 with a null self pointer and crash.
965 2000-07-18 Ulrich Drepper <drepper@redhat.com>
967 * spinlock.h (__pthread_alt_trylock): Fix code used if no
968 compare&swap is available.
970 * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
973 * pthread.c (pthread_initialize): Don't use sysconf to determine
974 whether the machine has more than one processor.
976 * spinlock.c (__pthread_alt_timedlock): Add back one of the
977 removed thread_self calls.
979 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
981 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
982 __compare_and_swap to compare_and_swap in code which assumes
983 compare swap is available.
985 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
987 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
988 bug whereby thr field of waitnode structure would not be correctly
989 set unless a null self pointer is passed to the functions.
990 Eliminated redundant calls to thread_self().
992 2000-07-18 Jakub Jelinek <jakub@redhat.com>
994 * pthread.c (__pthread_initialize_manager): Lock
995 __pthread_manager_thread.p_lock before calling clone.
997 2000-05-05 H.J. Lu <hjl@gnu.org>
999 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1000 have acquire semantics.
1001 (__compare_and_swap_with_release_semantics): New inline
1003 (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1005 2000-01-28 Hans Boehm <hboehm@exch.hpl.hp.com>
1007 * manager.c: Fix the problem with signals at startup.
1008 Change the way that thread stacks are allocated on IA64.
1009 Clean up some of the guard page allocation stuff.
1011 1999-12-19 H.J. Lu <hjl@gnu.org>
1013 * internals.h (page_roundup): New.
1014 * attr.c (__pthread_attr_setguardsize); Use page_roundup
1016 * manager.c (pthread_allocate_stack): Make sure guardaddr is
1017 page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1020 1999-12-17 Hans Boehm <hboehm@exch.hpl.hp.com>
1022 * manager.c (pthread_allocate_stack): Unmap the stack top
1023 if failed to map the stack bottom.
1025 (pthread_free): Fix the guard page.
1027 * pthread.c (pthread_initialize): Set rlimit correctly for
1028 NEED_SEPARATE_REGISTER_STACK.
1030 1999-12-16 H.J. Lu <hjl@gnu.org>
1032 * pthread.c (__pthread_initialize_manager): Pass
1033 __pthread_manager_thread_bos instead of
1034 __pthread_manager_thread_tos to __clone2.
1036 1999-12-16 H.J. Lu <hjl@gnu.org>
1038 * manager.c (pthread_allocate_stack): Correct the calculation
1039 of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1042 1999-12-13 H.J. Lu <hjl@gnu.org>
1044 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
1045 bit after setting ar.ccv.
1047 1999-12-12 H.J. Lu <hjl@gnu.org>
1049 * manager.c (pthread_allocate_stack): Make the starting
1050 address of the stack bottom page aligned. FIXME: it may
1051 need changes in other places.
1052 (pthread_handle_create): Likewise.
1054 1999-12-11 Hans Boehm <hboehm@exch.hpl.hp.com>
1056 * manager.c (pthread_allocate_stack): Handle
1057 NEED_SEPARATE_REGISTER_STACK.
1058 (pthread_handle_create): Likewise.
1059 * pthread.c (__pthread_initialize_manager): Likewise.
1061 * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
1063 1999-12-02 H.J. Lu <hjl@gnu.org>
1065 * sysdeps/ia64/pt-machine.h: New.
1067 2000-07-13 Ulrich Drepper <drepper@redhat.com>
1069 * wrapsyscall.c: Mark non-__ protected names as weak.
1072 2000-07-12 Bruno Haible <haible@clisp.cons.org>
1074 * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
1076 2000-07-12 Ulrich Drepper <drepper@redhat.com>
1078 * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
1079 Add tests also to new alternative spinlock implementation.
1080 * spinlock.h: Likewise.
1081 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1083 2000-07-06 Ulrich Drepper <drepper@redhat.com>
1085 * Version: Export __sigaction.
1086 * signals.c: Define __sigaction alias. Use __libc_sigaction instead
1088 * pthread.c: Use __libc_sigaction instead of __sigaction.
1090 * condvar.c: Implement pthread_condattr_getpshared and
1091 pthread_condattr_setpshared.
1092 * mutex.c: Implement pthread_mutexattr_getpshared and
1093 pthread_mutexattr_setpshared.
1094 * Versions: Export new functions.
1095 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1097 * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
1098 (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
1101 2000-07-04 Greg McGary <greg@mcgary.org>
1103 * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
1104 pragmas. Include bp-sym.h only if _LIBC.
1106 2000-07-04 Ulrich Drepper <drepper@redhat.com>
1108 * spinlock.c (__pthread_unlock): Properly place write barrier.
1109 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1111 2000-07-03 Ulrich Drepper <drepper@redhat.com>
1113 * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
1114 faster on SMP systems. No more emulation of compare&swap for adaptive
1116 * spinlock.h: Likewise.
1117 * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
1118 Replace fast with adaptive mutex.
1119 * mutex.c: Rewrite for replacement of fast by adaptive mutex.
1120 * condvar.c: Likewise.
1121 * pthread.c: Define and initialize __pthread_smp_kernel variable.
1122 * internals.h: Declare __pthread_smp_kernel.
1123 * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
1124 _pthread_fastlock structure.
1125 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1127 * pthread.c: Remove initialization to zero from global variables.
1129 2000-06-29 Jakub Jelinek <jakub@redhat.com>
1131 * shlib-versions: Make sparc64 GLIBC_2.2+ only.
1133 2000-06-28 Greg McGary <greg@mcgary.org>
1135 * weaks.c: Wrap BP_SYM () around weak extern declarations of
1136 pthread functions that have pointers in their return+arg signatures.
1138 2000-06-27 Greg McGary <greg@mcgary.org>
1140 * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
1141 extern declarations of pthread functions that have pointers in
1142 their return+arg signatures.
1144 2000-06-26 Ulrich Drepper <drepper@redhat.com>
1146 * Makefile (tests): Add ex11. Add rules to build it.
1147 * Examples/ex11.c: New file.
1148 * rwlock.c: Fix complete braindamaged previous try to implement
1151 * spinlock.c: Pretty print.
1153 2000-06-25 Ulrich Drepper <drepper@redhat.com>
1155 * Makefile (tests): Add ex10. Add rules to build it.
1156 * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
1157 pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
1158 * condvar.c (pthread_cond_wait): Allow mutex of kind
1159 PTHREAD_MUTEX_TIMED_NP.
1160 (pthread_cond_timedwait_relative): Likewise.
1161 * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
1162 (__pthread_mutex_trylock): Use __pthread_alt_trylock for
1163 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1164 (__pthread_mutex_lock): Use __pthread_alt_lock for
1165 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1166 (__pthread_mutex_timedlock): New function.
1167 (__pthread_mutex_unlock): Use __pthread_alt_unlock for
1168 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1169 (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
1170 (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
1171 * spinlock.c: Implement alternate fastlocks.
1172 * spinlock.h: Add prototypes.
1173 * Examples/ex10.c: New file.
1174 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1175 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1177 * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
1178 (__pthread_rwlock_timedrdlock): New function.
1179 (__pthread_rwlock_timedwrlock): New function.
1180 Use laternate fastlock function everywhere.
1182 2000-06-21 Andreas Jaeger <aj@suse.de>
1184 * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
1187 * join.c: Include <stdlib.h> for exit prototype.
1189 2000-06-20 Ulrich Drepper <drepper@redhat.com>
1191 * sysdeps/i386/useldt.h: Include <stdlib.h>.
1193 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
1194 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1196 * Makefile (libpthread-routines): Add barrier.
1197 (tests): Add ex9. Add rule to build ex9.
1198 * Versions: Export barrier functions.
1199 * barrier.c: New file.
1200 * Examples/ex9.c: New file.
1201 * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
1202 * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
1203 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1205 2000-06-19 H.J. Lu <hjl@gnu.org>
1207 * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
1208 HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
1209 (compare_and_swap_with_release_semantics): New. Default to
1210 compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
1213 * spinlock.c (__pthread_unlock): Call
1214 compare_and_swap_with_release_semantics () instead of
1215 compare_and_swap ().
1217 2000-06-19 Ulrich Drepper <drepper@redhat.com>
1219 * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
1221 * sysdeps/pthread/timer_delete.c: Likewise.
1222 * sysdeps/pthread/timer_getoverr.c: Likewise.
1223 * sysdeps/pthread/timer_gettime.c: Likewise.
1224 * sysdeps/pthread/timer_settime.c: Likewise.
1226 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
1228 Timer nodes are now reference counted, and can be marked
1229 as deleted. This allows for the safe release of the global mutex
1230 in the middle without losing the timer being operated on.
1232 * sysdeps/pthread/posix-timer.h (struct timer_node): The inuse
1233 member is now an enum with three values, so that an intermediate
1234 state can be represented (deleted but not free for reuse yet).
1235 New refcount member added.
1236 * sysdeps/pthread/timer_routines.c: Likewise.
1238 * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
1239 timer_valid): New inline functions added.
1241 * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
1242 restructured, recursive deadlock bug fixed.
1244 * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
1245 timer_addref to ensure that timer won't be deleted while mutex is not
1246 held. Also uses timer_invalid to perform validation of timer handle.
1247 * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
1248 * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
1250 2000-06-14 Ulrich Drepper <drepper@redhat.com>
1252 * shlib-versions: Add entry for SH.
1253 Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
1255 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
1257 A few optimizations. Got rid of unnecessary wakeups of timer threads,
1258 tightened up some critical regions and micro-optimized some list
1261 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1262 Returns int value now to indicate whether timer was queued at head.
1263 * sysdeps/pthread/posix-timer.h: Likewise.
1264 * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
1265 new return value from __timer_thread_queue_timer to avoid waking
1266 up timer thread unnecessarily.
1268 * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
1269 inuse flag, because this requires mutex to be held. Callers updated
1270 to do the check when they have the mutex.
1271 * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
1273 * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
1274 regions: avoids making system calls while holding timer mutex, and
1275 a few computations were moved outside of the mutex as well.
1276 * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
1278 * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
1279 to list_unlink_ip, meaning idempotent. Pointer manipulation
1280 changed to get better better code out of gcc.
1281 * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
1282 version of list_unlink added here.
1283 * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
1284 function in all places: idempotent one for timers, non-idempotent
1285 one for thread nodes.
1286 * sysdeps/pthread/timer_settime: Likewise.
1287 * sysdeps/pthread/timer_routines.c: Likewise.
1289 2000-06-13 Ulrich Drepper <drepper@redhat.com>
1291 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
1292 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1294 * sysdeps/pthread/Makefile: Remove tests definition.
1296 2000-06-12 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
1297 Yutaka Niibe <gniibe@chroot.org>
1299 * sysdeps/sh/pspinlock.c: New file.
1300 * sysdeps/sh/pt-machine.h: New file.
1302 2000-06-12 Ulrich Drepper <drepper@redhat.com>
1304 * Makefile (tests): Add joinrace.
1306 * Examples/ex6.c: Test return value of pthread_join.
1308 2000-06-11 Geoff Keating <geoffk@cygnus.com>
1310 * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
1311 (__pthread_spin_trylock): Implement.
1312 (__pthread_spin_unlock): Implement.
1313 (__pthread_spin_init): Implement.
1314 (__pthread_spin_destroy): Implement.
1316 2000-06-10 Ulrich Drepper <drepper@redhat.com>
1318 * sysdeps/pthread/timer_routines.c (list_append): Little fix to
1319 really append the entry.
1321 2000-06-10 Andreas Jaeger <aj@suse.de>
1323 * lockfile.c (__fresetlockfiles): Remove unused variable fp.
1325 2000-06-10 Kaz Kylheku <kaz@ashi.footprints.net>
1327 * sysdeps/pthread/timer_create.c: Thread matching now done on
1328 clock type as well as thread attributes.
1329 There are individual global signal-delivering threads for
1330 different clock types.
1331 * sysdeps/pthread/posix-timer.h: Likewise.
1332 * sysdeps/pthread/timer_routines.c: Likewise.
1334 * sysdeps/pthread/timer_routines.c: Thread allocation and
1335 deallocation function now remembers to put thread on active
1336 list and remove from active list.
1337 Thus now the feature of binding multiple timers
1338 to a single thread actually works.
1340 2000-06-10 Ulrich Drepper <drepper@redhat.com>
1342 * pthread.c (__pthread_create_2_1): Optimize a bit.
1344 * internals.h (invalid_handle): Also test for p_terminated != 0.
1345 (nonexisting_handle): New function. Same as old invalid_handle.
1346 * join.c (pthread_join): Use nonexisting_handle instead of
1347 invalid_handle to test for acceptable thread handle.
1348 * manager.c (pthread_handle_free): Likewise.
1349 * joinrace.c: New file.
1350 Reported by Permaine Cheung <pcheung@cygnus.com>.
1352 2000-06-08 Ulrich Drepper <drepper@redhat.com>
1354 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1355 Correct handling of matching variable.
1357 * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
1360 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1361 Be prepared for empty timer list.
1363 * sysdeps/pthread/timer_create.c (timer_create): Correct names of
1364 CPUTIME clock ID. Add support for thread clocks.
1366 * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
1367 subtraction were switched.
1369 * sysdeps/pthread/timer_routines.c (init_module): Use
1370 THREAD_MAXNODES threads.
1372 * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
1373 * sysdeps/pthread/timer_create.c: Fill in creator_pid.
1374 * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
1375 with sigqueueinfo is this system call is available.
1377 * sysdeps/pthread/timer_create.c (timer_create): Allow
1378 CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
1380 * sysdeps/pthread/Makefile: New file. Add rules to build timer
1382 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
1384 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
1386 * sysdeps/pthread/posix-timer.h: New file.
1387 * sysdeps/pthread/timer_create.c: New file.
1388 * sysdeps/pthread/timer_delete.c: New file.
1389 * sysdeps/pthread/timer_getoverr.c: New file.
1390 * sysdeps/pthread/timer_gettime.c: New file.
1391 * sysdeps/pthread/timer_routines.c: New file.
1392 * sysdeps/pthread/timer_settime.c: New file.
1393 * sysdeps/pthread/tst-timer.c: New file.
1395 2000-06-08 Ulrich Drepper <drepper@redhat.com>
1397 * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
1398 LINK_MAX definitions if necessary.
1400 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
1402 Added missing fork time handling of global libio lock.
1404 * lockfile.c (__fresetlockfiles): Now also resets the list lock,
1405 not just the individual stream locks. Rewritten to use new
1406 iterator interface provided by libio rather than accessing
1409 * lockfile.c (__flockfilelist, _funlockfilelist): New functions
1410 which lock and unlock the stream list using the new interface
1412 * internals.h: Likewise.
1414 * ptfork.c (__fork): Now calls __flockfilelist before fork,
1415 and __funlockfilelist in the parent after the fork.
1416 Child still calls __fresetlockfiles as before.
1418 * linuxthreads.texi: Now explains what happens to streams at
1419 fork time. Also whole new section on forking and thread added.
1420 Definition of pthread_atfork moved out of Miscellaneous Functions
1421 to this new section.
1423 2000-06-04 Jakub Jelinek <jakub@redhat.com>
1425 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
1426 Add missing register.
1427 * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
1429 2000-06-02 Jakub Jelinek <jakub@redhat.com>
1431 * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
1432 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
1433 * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
1435 2000-05-31 Andreas Jaeger <aj@suse.de>
1437 * sysdeps/mips/pspinlock.c: Implement spinlocks.
1439 2000-05-28 Ulrich Drepper <drepper@redhat.com>
1441 * spinlock.c (__pthread_lock): Remove ASSERT.
1443 * Makefile (tests): Add ex8.
1444 * Examples/ex8.c: New file.
1446 2000-05-12 Kaz Kylheku <kaz@ashi.footprints.net>
1448 Bugfix: The pthread_atfork mechanism now takes care of its
1449 own internal mutex at fork time.
1451 * ptfork.c (__fork): Revised so that the mutex is held across
1452 the fork operation and while the handlers are called, and so that
1453 the child resets the mutex.
1455 * linuxthreads.texi: Updated pthread_atfork documentation to make
1456 it clear that fork and pthread_atfork can't be reentered from
1457 atfork handlers, that pthread_atfork and fork are mutually atomic,
1458 and that the handlers are inherited by the child process.
1460 2000-05-24 Ulrich Drepper <drepper@redhat.com>
1462 * Makefile (libpthread-routines): Add pspinlock.
1463 * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
1464 Use struct _pthread_fastlock instead of pthread_spinlock_t.
1465 * condvar.c: Likewise.
1466 * internals.h: Likewise.
1468 * manager.c: Likewise.
1469 * mutex.c: Likewise.
1470 * pthread.c: Likewise.
1471 * rwlock.c: Likewise.
1472 * semaphore.c: Likewise.
1473 * signals.c: Likewise.
1474 * spinlock.h: Likewise.
1475 * spinlock.c: Likewise. Remove pthread_spin_lock functions.
1476 * sysdeps/alpha/pspinlock.c: New file.
1477 * sysdeps/arm/pspinlock.c: New file.
1478 * sysdeps/i386/pspinlock.c: New file.
1479 * sysdeps/m68k/pspinlock.c: New file.
1480 * sysdeps/mips/pspinlock.c: New file.
1481 * sysdeps/powerpc/pspinlock.c: New file.
1482 * sysdeps/sparc/sparc32/pspinlock.c: New file.
1483 * sysdeps/sparc/sparc64/pspinlock.c: New file.
1484 * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
1485 back to _pthread_fastlock. Define new pthread_spinlock_t.
1487 2000-05-24 Andreas Jaeger <aj@suse.de>
1489 * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
1491 2000-05-21 Jakub Jelinek <jakub@redhat.com>
1493 * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
1495 2000-05-13 Jakub Jelinek <jakub@redhat.com>
1497 * internals.h (__RES_PTHREAD_INTERNAL): Define.
1499 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
1501 * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
1502 object state is represented with additional bits which distinguish
1503 whether that state was set up in the current process, or
1504 in an ancestor process. If that state was set in an ancestor,
1505 it means that a fork happened while thread was executing the init
1506 function. In that case, the state is reset to NEVER.
1507 * mutex.c (__pthread_once_fork_prepare): New function.
1508 (__pthread_once_fork_child): Likewise
1509 (__pthread_once_fork_parent): Likewise
1510 (__pthread_reset_pthread_once): Removed.
1511 * ptfork.c (__fork): Call new handlers in mutex.c.
1512 * internals.h: Declarations of new mutex.c functions added.
1513 Declaration of removed function deleted.
1514 * linuxthreads.texi: Updated documentation about pthread_once
1515 to clarify what happens under cancellation and forking.
1517 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
1519 * internals.h: New thread manager request type, REQ_KICK.
1520 * join.c (pthread_exit): main thread now calls exit() instead
1521 of _exit() in order to proper process cleanup.
1522 * manager.c (__pthread_manager): Do not terminate manager
1523 after unblocking main thread; wait for main thread's
1524 REQ_PROCESS_EXIT request instead.
1525 Also, added REQ_KICK case to handle new request; this just does
1527 * manager.c (pthread_exited): Do not terminate manager after
1528 unblocking main thread.
1529 * manager.c (__pthread_manager_sighandler): If the main thread
1530 is waiting for all other threads to die, send a REQ_KICK into
1531 the thread manager request pipe to get it to clean out the threads
1532 and unblock the main thread as soon as possible. This fixes
1533 the 2000 millisecond hang on shutdown bug.
1534 * Examples/ex7.c: New file, tests shutdown behavior when all threads
1535 including the main one call pthread_exit(), or implicitly do so.
1536 * Makefile (tests): Add ex7.
1538 2000-05-05 Andreas Jaeger <aj@suse.de>
1540 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1541 (pthread_getcpuclockid): Correct test for ourselves.
1543 2000-05-05 Ulrich Drepper <drepper@redhat.com>
1545 * internals.h (struct _pthread_descr_struct): Reorganization.
1546 Allocate room for 16 pointers at head of the structure for future
1547 thread-local data handling. Move p_self member in this area.
1548 * manager.c (pthread_handle_create): Adjust use of p_self.
1549 * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
1550 * pthread.c (__pthread_initial_thread): Adjust initialization.
1551 (__pthread_manager_thread): Likewise.
1553 2000-04-29 Bruno Haible <haible@clisp.cons.org>
1555 * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
1556 for eventmask larger than 1 word.
1558 2000-04-27 Ulrich Drepper <drepper@redhat.com>
1560 * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
1561 * pthread.c (__pthread_initialize_minimal): New function. Perform
1562 minimal initialization.
1563 (pthread_initialize): Remove this code here.
1564 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again. We
1565 are working around the problem in glibc.
1567 2000-04-25 Ulrich Drepper <drepper@redhat.com>
1569 * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
1570 now. First gcc must be fixed (more concrete: libgcc).
1572 2000-04-24 Ulrich Drepper <drepper@redhat.com>
1574 * pthread.c: Remove special treatement for interrupt handlers on x86.
1575 * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
1576 * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
1578 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
1580 2000-04-24 Mark Kettenis <kettenis@gnu.org>
1582 * join.c (pthread_exit): Set p_terminated after reporting the
1583 termination event instead of before.
1585 2000-04-20 Jakub Jelinek <jakub@redhat.com>
1587 * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
1590 2000-04-18 Andreas Jaeger <aj@suse.de>
1592 * Versions: Use ld instead of ld.so.
1594 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1596 * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
1597 Remove the typedef keyword.
1599 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1601 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
1603 (READ_MEMORY_BARRIER): Define.
1604 * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
1606 * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
1609 2000-04-17 Ulrich Drepper <drepper@redhat.com>
1611 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1612 (pthread_getcpuclockid): Don't compare thread_id with thread_self,
1613 use thread_handle().
1615 2000-04-16 Ulrich Drepper <drepper@redhat.com>
1617 * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
1618 if fast mutex is used. Don't initialize `already_canceled' twice.
1619 Correctly test for return value of timedsuspend.
1621 * pthread.c: Correct long-time braino. We never set SA_SIGINFO and
1622 therefore don't need the _rt versions of the signal handlers.
1624 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1626 * pthread.c (pthread_yield): New function.
1627 * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
1628 * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
1629 * internals.h: Declare __pthread_yield.
1631 * pthread.c (pthread_initialize): Avoid a bit more code if
1632 realtime signals are known to exist.
1634 * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
1635 to dynamically detect RT signals and avoid generating compatibility
1636 functions with old kernel.
1637 * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
1638 __pthread_restart_new directly.
1639 (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
1640 __pthread_wait_for_restart_signal directly.
1641 (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
1642 __pthread_timedsuspend_new directly.
1644 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1646 * condvar.c: Remove all the special code to handle cond_timedwait.
1647 Use timedsuspend instead.
1648 * internals.h: Declare __pthread_timedsuspend_old,
1649 __pthread_timedsuspend_new, and __pthread_timedsuspend.
1650 Remove declaration of __pthread_init_condvar.
1651 * pthread.c: Define __pthread_timedsuspend variable.
1652 (__pthread_timedsuspend_old): New function. Timed suspension
1653 implementation for old Linux kernels.
1654 (__pthread_timedsuspend_new): New function. Timed suspension
1655 implementation for new Linux kernels.
1656 * restart.h (timedsuspend): New function. Call appropriate
1657 suspension function through __pthread_timedsuspend.
1658 * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
1660 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1662 * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
1664 * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
1666 * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
1667 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1669 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
1670 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1672 2000-04-14 Andreas Jaeger <aj@suse.de>
1674 * weaks.c: Fix typo.
1676 * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
1677 2.2 for linuxthreads.
1679 2000-04-13 Ulrich Drepper <drepper@redhat.com>
1681 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1682 (pthread_getcpuclockid): Fix typo.
1684 2000-04-12 Ulrich Drepper <drepper@redhat.com>
1686 * Makefile (libpthread-routines): Add getcpuclockid.
1687 * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
1688 * sysdeps/pthread/getcpuclockid.c: New file.
1689 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
1690 * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
1692 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
1694 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1696 * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
1697 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1698 and pthread_spin_unlock.
1699 * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
1700 into pthread_spinlock_t. Change all uses.
1701 * spinlock.c: Implement pthread_spin_lock.
1702 Rename __pthread_unlock to __pthread_spin_unlock and define weak
1703 alias for real name.
1704 Define pthread_spin_trylock, pthread_spin_init, and
1705 pthread_spin_destroy.
1706 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1707 * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
1708 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1709 * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
1710 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1711 and pthread_spin_unlock.
1712 * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
1713 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1714 * condvar.c: Likewise.
1715 * internals.h: Likewise.
1717 * manager.c: Likewise.
1718 * mutex.c: Likewise.
1719 * pthread.c: Likewise.
1720 * rwlock.c: Likewise.
1721 * semaphore.c: Likewise.
1722 * signals.c: Likewise.
1724 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
1726 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1728 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1730 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
1731 _POSIX_SHARED_MEMORY_OBJECTS.
1733 2000-04-11 Andreas Jaeger <aj@suse.de>
1735 * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
1736 (__compare_and_swap): Mark as modifying memory.
1738 2000-04-11 Geoff Keating <geoffk@cygnus.com>
1740 * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
1742 (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
1743 Don't have the 'asm' __volatile__.
1745 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1747 * internals.h: Define MEMORY_BARRIER as empty if not defined already.
1748 * spinlock.c (__pthread_lock): Add memory barriers.
1749 (__pthread_unlock): Likewise.
1750 * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
1752 (RELEASE): Not needed anymore.
1753 (__compare_and_swap): Mark asm as modifying memory.
1754 * sysdeps/powerpc/pt-machine.h (sync): Remove. Replace with definition
1756 (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
1757 * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
1758 (MEMORY_BARRIER): Define using stbar.
1759 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
1761 (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
1762 Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
1763 Mike Burrows <m3b@pa.dec.com>.
1765 2000-04-09 Ulrich Drepper <drepper@redhat.com>
1767 * signals.c (sigaction): Fix return value for the case SIG is one
1768 of the signals the implementation uses.
1769 Patch by Xavier.Leroy@inria.fr.
1771 2000-04-01 Andreas Jaeger <aj@suse.de>
1773 * attr.c: Use shlib-compat macros.
1774 * oldsemaphore.c: Likewise.
1775 * pthread.c: Likewise.
1776 * weaks.c: Likewise.
1778 2000-03-26 Ulrich Drepper <drepper@redhat.com>
1780 * semaphore.c (sem_timedwait): New function.
1781 Patch by Carl Mailloux <carlm@oricom.ca>.
1782 * semaphore.h: Declare sem_timedwait.
1783 * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
1785 2000-03-26 Roland McGrath <roland@baalperazim.frob.com>
1787 * sysdeps/pthread/Makefile: File removed.
1789 2000-03-23 Ulrich Drepper <drepper@redhat.com>
1791 * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
1792 * internals.h (__pthread_reset_pthread_once): Add prototype.
1793 * ptfork.c (__fork): Call __pthread_reset_pthread_once.
1795 * manager.c (pthread_handle_create): Store ID of new thread before
1798 2000-03-21 Ulrich Drepper <drepper@redhat.com>
1800 * attr.c: Use new macros from shlib-compat.h to define versions.
1801 * oldsemaphore.c: Likewise.
1802 * semaphore.c: Likewise.
1803 * weaks.c: Likewise.
1805 * pthread.c: Update for new SHLIB_COMPAT definition.
1807 * manager.c (__pthread_manager): Unmask debug signal.
1809 * pthread.c (pthread_initialize): Test for address of __dso_handle
1810 being NULL, not value. Use __on_exit, not on_exit.
1811 Patch by Andreas Jaeger <aj@suse.de>.
1813 * pthread.c: Use new macros from shlib-compat.h to define versions.
1815 2000-03-19 Ulrich Drepper <drepper@redhat.com>
1817 * pthread.c (pthread_initialize): Instead of on_exit use
1818 __cxa_atexit if __dso_label is available to allow unloading the
1819 libpthread shared library.
1821 2000-03-16 Ulrich Drepper <drepper@redhat.com>
1823 * condvar.c: Make tests for ownership of mutex less strict.
1825 2000-03-14 Ulrich Drepper <drepper@redhat.com>
1827 * condvar.c (pthread_cond_wait): Check whether mutex is owned by
1828 current thread and return error if not.
1829 (pthread_cond_timedwait_relative_old): Likewise.
1830 (pthread_cond_timedwait_relative_new): Likewise.
1832 * mutex.c (__pthread_once): Handle cancelled init function correctly.
1833 (pthread_once_cancelhandler): New function.
1834 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1836 2000-03-14 Andreas Jaeger <aj@suse.de>
1838 * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
1840 (pthread_handle_sigrestart_rt): Likewise.
1841 * signals.c (pthread_sighandler_rt): Likewise.
1843 2000-03-02 Andreas Jaeger <aj@suse.de>
1845 * sysdeps/pthread/bits/libc-lock.h: Fix typo.
1846 Reported by Sean Chen <sean.chen@turbolinux.com>.
1848 2000-02-28 Andreas Jaeger <aj@suse.de>
1850 * rwlock.c: Fix typo.
1852 2000-02-27 Ulrich Drepper <drepper@redhat.com>
1854 * rwlock.c: Define __* variants of the functions and make old names
1856 * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
1857 * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
1859 2000-02-25 Andreas Jaeger <aj@suse.de>
1861 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1862 pwrite64, lseek64, open64, and __open64 with version 2.2.
1864 2000-02-22 Ulrich Drepper <drepper@redhat.com>
1866 * semaphore.h (SEM_FAILED): Use 0 not NULL.
1868 2000-02-14 Ulrich Drepper <drepper@redhat.com>
1870 * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
1871 nanosleep does not work either. Get absolute time inside the
1873 (pthread_cond_timedwait_relative_new): Likewise.
1874 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1876 2000-02-13 Andreas Jaeger <aj@suse.de>
1878 * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
1879 (pthread_cond_timedwait_relative_old): Likewise.
1881 2000-02-13 Ulrich Drepper <drepper@redhat.com>
1883 * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
1884 but keep the code around. A bug in the kernel prevent us from
1886 (pthread_cond_timedwait_relative_new): Likewise.
1887 (PR libc/1597 and libc/1598).
1889 2000-02-01 Kaz Kylheku <kaz@ashi.footprints.net>
1891 * condvar.c (pthread_cond_timedwait_relative_old): Do tight
1892 loop around nanosleep calls instead of around most of the function
1893 (pthread_cond_timedwait_relative_new): Likewise.
1894 body. Got rid of backwards goto and one local.
1896 2000-01-31 Ulrich Drepper <drepper@redhat.com>
1898 * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
1899 before every nanosleep call to account for time spent in the rest
1901 (pthread_cond_timedwait_relative_new): Likewise.
1902 Patch by khendricks@ivey.uwo.ca (PR libc/1564).
1904 2000-01-29 Ulrich Drepper <drepper@redhat.com>
1906 * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
1907 from nanosleep call so that in case we restart we only wait for the
1909 (pthread_cond_timedwait_relative_new): Likewise.
1910 Patch by khendricks@ivey.uwo.ca (PR libc/1561).
1912 2000-01-18 Ulrich Drepper <drepper@cygnus.com>
1914 * manager.c (pthread_allocate_stack): Compute guard page address
1915 correctly. Patch by HJ Lu.
1917 * sysdeps/pthread/pthread.h: Define
1918 PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
1920 2000-01-16 Ulrich Drepper <drepper@cygnus.com>
1922 * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
1923 preference handling.
1924 (pthread_rwlockattr_setkind_np): Allow
1925 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
1926 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1928 2000-01-12 Ulrich Drepper <drepper@cygnus.com>
1930 * internals.h (pthread_readlock_info): New structure.
1931 (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
1932 p_untracked_readlock_count.
1933 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1934 Add initializers for new fields.
1935 * manager.c (pthread_free): Free read/write lock lists.
1936 * queue.h (queue_is_empty): New function.
1937 * rwlock.c: Implement requirements about when readers should get
1939 * sysdeps/pthread/pthread.h
1940 (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
1941 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
1942 Define this name as well.
1943 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1945 2000-01-05 Ulrich Drepper <drepper@cygnus.com>
1947 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1948 Adjust initializers for struct _pthread_descr_struct change.
1949 * internals.h (struct _pthread_descr_struct): Move new elements to
1952 2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
1954 Redesigned how cancellation unblocks a thread from internal
1955 cancellation points (sem_wait, pthread_join,
1956 pthread_cond_{wait,timedwait}).
1957 Cancellation won't eat a signal in any of these functions
1958 (*required* by POSIX and Single Unix Spec!).
1959 * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
1960 simultaneous condition variable signal (not required by POSIX
1961 or Single Unix Spec, but nice).
1962 * spinlock.c: __pthread_lock queues back any received restarts
1963 that don't belong to it instead of assuming ownership of lock
1964 upon any restart; fastlock can no longer be acquired by two threads
1966 * restart.h: Restarts queue even on kernels that don't have
1967 queued real time signals (2.0, early 2.1), thanks to atomic counter,
1968 avoiding a rare race condition in pthread_cond_timedwait.
1970 1999-12-31 Andreas Jaeger <aj@suse.de>
1972 * internals.h: Remove duplicate prototype declarations.
1974 * weaks.c: Remove __THROW from prototypes since the file is not
1975 compiled by a C++ compiler.
1976 * internals.h: Likewise.
1978 1999-12-30 Andreas Jaeger <aj@suse.de>
1980 * sysdeps/pthread/pthread.h: Move internal functions to...
1981 * sysdeps/pthread/bits/libc-lock.h: ...here.
1983 1999-12-29 Andreas Jaeger <aj@suse.de>
1985 * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
1987 1999-12-28 Ulrich Drepper <drepper@cygnus.com>
1989 * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
1992 * manager.c (__pthread_start): Add one more cast to prevent
1993 warning on 64bit machines.
1995 1999-12-21 Ulrich Drepper <drepper@cygnus.com>
1997 * manager.c (pthread_handle_create): Set p_pid of new thread
1998 before calling the callback function to report a new thread.
2000 1999-12-20 Andreas Jaeger <aj@suse.de>
2002 * pthread.c (pthread_initialize): Move getrlimit call after
2005 1999-12-18 Ulrich Drepper <drepper@cygnus.com>
2007 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2008 pwrite64, lseek64, open64, and __open64.
2009 * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2010 pwrite64, lseek64, open64, and __open64.
2012 * manager.c (pthread_allocate_stack): Correct computation of
2013 new_thread_bottom. Correct handling of stack size and when the
2014 rlimit method to guard for stack growth is used.
2015 * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2016 minus one pagesize (not two).
2018 1999-12-03 Andreas Jaeger <aj@suse.de>
2020 * Versions: Add __res_state with version GLIBC_2.2.
2022 * errno.c (__res_state): New function to return thread specific
2025 * pthread.c (pthread_initialize): Initialize p_resp.
2026 (__pthread_reset_main_thread): Also set p_resp.
2028 * manager.c (pthread_handle_create): Initialize p_resp.
2030 * internals.h: Add thread specific resolver state.
2031 Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2033 1999-12-01 Ulrich Drepper <drepper@cygnus.com>
2035 * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2037 * sysdeps/i386/i686/pt-machine.h: Likewise.
2038 Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2040 1999-11-23 Ulrich Drepper <drepper@cygnus.com>
2042 * manager.c (pthread_start_thread_event): Initialize p_pid already
2045 1999-11-22 Ulrich Drepper <drepper@cygnus.com>
2047 * internals.h: Add prototype for __pthread_manager_event.
2048 * manager.c (__pthread_manager_event): New function.
2049 (pthread_start_thread_event): Correct computation of self.
2050 Use INIT_THREAD_SELF.
2051 * pthread.c (__pthread_manager_thread): Initialize p_lock.
2052 (__pthread_initialize_manager): Respect event flags also for creation
2053 of the manager thread.
2055 1999-11-08 Ulrich Drepper <drepper@cygnus.com>
2057 * pthread.c (__pthread_initialize_manager): Initialize
2058 __pthread_manager_thread.p_tid.
2060 1999-11-02 Ulrich Drepper <drepper@cygnus.com>
2062 * internals.h: Declare __pthread_last_event.
2063 * manager.c: Define __pthread_last_event.
2064 (pthread_handle_create): Set __pthread_last_event.
2065 (pthread_exited): Likewise.
2066 * join.c (pthread_exit): Likewise.
2068 * Makefile (libpthread-routines): Add events.
2069 * events.c: New file.
2070 * internals.h: Protect against multiple inclusion.
2071 Include thread_dbP.h header.
2072 (struct _pthread_descr_struct): Add new fields p_report_events and
2074 Declare event reporting functions.
2075 * join.c (pthread_exit): Signal event if this is wanted.
2076 * manager.c (__pthread_threads_events): New variable.
2077 (pthread_handle_create): Take new parameters with event information.
2078 Signal TD_CREATE event if wanted.
2079 (__pthread_manager): Adjust pthread_handle_create call.
2080 (pthread_start_thread_event): New function. Block until manager is
2081 finished and then call pthread_start_thread.
2082 (pthread_exited): Signal TD_REAP event if wanted.
2084 1999-10-26 Ulrich Drepper <drepper@cygnus.com>
2086 * restart.h (suspend_with_cancellation): Rewrite as a macro.
2088 * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
2090 1999-10-25 Andreas Jaeger <aj@suse.de>
2092 * internals.h: Remove K&R compatibility.
2093 * no-tsd.c: Likewise.
2094 * semaphore.h: Likewise.
2095 * signals.c: Likewise.
2096 * sysdeps/pthread/bits/libc-tsd.h: Likewise.
2097 * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
2098 * weaks.c: Likewise.
2100 1999-10-21 Xavier Leroy <Xavier.Leroy@inria.fr>
2102 * pthread.c: For i386, wrap pthread_handle_sigrestart and
2103 pthread_handle_sigcancel with functions that restore %gs from the
2104 signal context. For each signal handling function, two wrappers
2105 are required, one for a non-RT signal and one for a RT signal.
2106 * signal.c: For i386, add code to restore %gs from the signal
2107 context in pthread_sighandler and pthread_sighandler_rt.
2109 1999-10-17 Ulrich Drepper <drepper@cygnus.com>
2111 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
2113 1999-10-14 Ulrich Drepper <drepper@cygnus.com>
2115 * pthread.c (__pthread_initial_thread): Pass argument to
2116 PTHREAD_START_ARGS_INITIALIZER.
2117 (__pthread_manager_thread): Likewise.
2119 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
2120 initialize function.
2122 * manager.c (pthread_handle_create): Remove p_startfct initialization.
2124 * internals.h (_pthread_descr_struct): We don't need p_startfct field.
2126 1999-10-12 Ulrich Drepper <drepper@cygnus.com>
2128 * internals.h: Correct return types for __libc_read and __libc_write.
2130 1999-10-09 Andreas Jaeger <aj@suse.de>
2132 * internals.h: Add __new_sem_post to get prototype in
2133 manager.c; include semaphore.h for needed types.
2135 1999-10-08 Ulrich Drepper <drepper@cygnus.com>
2137 * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
2138 directly instead of calling sem_post which should not be necessary
2139 but is faster and might help in some case to work around problems.
2140 Patch by khendricks@ivey.uwo.ca [libc/1382].
2142 1999-10-08 Andreas Schwab <schwab@suse.de>
2144 * sysdeps/pthread/Subdirs: New file.
2147 1999-10-07 Ulrich Drepper <drepper@cygnus.com>
2149 * Implies: New file.
2150 * internals.h (struct _pthread_descr_struct): Add p_startfct.
2151 * manager.c (pthread_handle_create): Initialize p_startfct.
2152 * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
2154 1999-09-25 Ulrich Drepper <drepper@cygnus.com>
2156 * manager.c (__linuxthreads_pthread_threads_max): New variable.
2157 * specific.c (__linuxthreads_pthread_keys_max): New variable.
2158 (__linuxthreads_pthread_key_2ndlevel_size): New variable.
2160 * condvar.c (pthread_cond_timedwait_relative): Never return with
2161 EINTR. Patch by Andreas Schwab.
2163 1999-09-19 Ulrich Drepper <drepper@cygnus.com>
2165 * signals.c (sigaction): Correct last patch. Don't select
2166 pthread_sighandler_rt based on the signal number but instead of
2167 the SA_SIGINFO flag.
2169 1999-09-23 Ulrich Drepper <drepper@cygnus.com>
2171 * specific.c: Move definitions of struct pthread_key_struct and
2172 destr_function to ...
2173 * internals.h: ...here.
2175 1999-09-18 Ulrich Drepper <drepper@cygnus.com>
2177 * pthread.c (pthread_handle_sigrestart_rt): New function. Use
2178 this instead of pthread_handle_sigrestart if the signal is an RT
2181 * signals.c: Handle passing through of sighandler arguments also
2182 for real-time signals.
2184 1999-09-03 Andreas Schwab <schwab@suse.de>
2186 * ptfork.c (__fork): Renamed from fork and use __libc_fork. Add
2188 (__vfork): New function, alias vfork.
2189 * Versions: Export __fork, vfork, and __vfork in libpthread.
2191 1999-08-23 Andreas Schwab <schwab@suse.de>
2193 * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
2194 call to signal handler.
2196 1999-08-20 Ulrich Drepper <drepper@cygnus.com>
2198 * pthread.c (__pthread_reset_main_thread): Undo last change.
2199 (__pthread_kill_other_threads_np): Reset signal handlers for the
2200 signals we used in the thread implementation here.
2202 1999-08-19 Ulrich Drepper <drepper@cygnus.com>
2204 * pthread.c (__pthread_reset_main_thread): Reset signal handlers
2205 for the signals we used in the thread implementation [PR libc/1234].
2207 * Versions: Export __pthread_kill_other_threads_np from libpthread
2210 * signals.c: Pass sigcontext through wrapper to the user function.
2212 1999-08-01 Ulrich Drepper <drepper@cygnus.com>
2214 * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
2215 __libc_internal_tsd_set.
2217 1999-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2219 * manager.c: Remove inclusion of <linux/tasks.h> since it's not
2222 1999-07-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2224 * internals.h: Align _pthread_descr_struct to 32 bytes.
2225 Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
2228 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
2230 * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
2233 1999-07-09 Cristian Gafton <gafton@redhat.com>
2235 * Makefile (libpthread-routines): Add oldsemaphore routine.
2236 * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
2237 sem_trywait, and sem_wait to GLIBC_2.1.
2238 * oldsemaphore.c: New file.
2239 * semaphore.c: Add default_symbol_versions for the changed functions.
2240 (__new_sem_init): Rename from sem_init.
2241 (__new_sem_post): Rename from sem_post.
2242 (__new_sem_wait): Rename from sem_wait.
2243 (__new_sem_trywait): Rename from sem_trywait.
2244 (__new_sem_getvalue): Rename from sem_getvalue.
2245 (__new_sem_destroy): Rename from sem_destroy.
2247 1999-06-23 Robey Pointer <robey@netscape.com>
2249 * internals.h: Added p_nextlock entry to separate queueing for a
2250 lock from queueing for a CV (sometimes a thread queues on a lock
2251 to serialize removing itself from a CV queue).
2252 * pthread.c: Added p_nextlock to initializers.
2253 * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
2255 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
2257 * manager.c (pthread_handle_create): Free mmap region after stack
2258 if clone failed. Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
2260 1999-05-23 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2262 * man/pthread_cond_init.man: Correct example.
2263 Reported by Tomas Berndtsson <tomas@nocrew.org>.
2265 * linuxthreads.texi (Condition Variables): Likewise.
2267 1999-05-18 Jakub Jelinek <jj@ultra.linux.cz>
2269 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
2270 casx not cas, also successful casx returns the old value in rd
2271 and not the new value.
2273 1999-05-16 Xavier Leroy <Xavier.Leroy@inria.fr>
2275 * manager.c: If pthread_create() is given a NULL attribute
2276 and the thread manager runs with a realtime policy, set the
2277 scheduling policy of the newly created thread back to SCHED_OTHER.
2278 * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
2279 initialize the schedpolicy field of new_thread->p_start_args
2280 to that of the calling thread.
2282 1999-04-29 Ulrich Drepper <drepper@cygnus.com>
2284 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
2285 instruction does not allow memory element to use offset.
2287 1999-04-28 Ulrich Drepper <drepper@cygnus.com>
2289 * manager.c (pthread_allocate_stack): Optimize initialization of new
2292 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
2293 Don't use initializer since it is all zeroes.
2294 (__libc_once_define): Likewise.
2296 1999-04-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2298 * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
2299 doesn't exist anymore.
2300 * sysdeps/i386/Implies: Likewise.
2301 * sysdeps/m68k/Implies: Likewise.
2302 * sysdeps/mips/Implies: Likewise.
2303 * sysdeps/powerpc/Implies: Likewise.
2304 * sysdeps/sparc/sparc32/Implies: Likewise.
2305 * sysdeps/sparc/sparc64/Implies: Likewise.
2307 1999-04-15 Ulrich Drepper <drepper@cygnus.com>
2309 * sysdeps/alpha/bits/semaphore.h: Removed.
2310 * sysdeps/powerpc/bits/semaphore.h: Removed.
2311 * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
2312 * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
2313 * Makefile (headers): Remove bits/semaphore.h.
2315 * semaphore.h: Define _pthread_descr if necessary.
2316 Don't include limits.h. Define SEM_VALUE_MAX directly.
2318 (sem_t): Protect element names with leading __.
2319 Add declarations for sem_close, sem_open, and sem_unlink.
2320 * semaphore.c: Adjust all functions for new element names.
2321 Define sem_close, sem_open, and sem_unlink.
2322 * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
2324 * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
2327 1999-03-16 H.J. Lu <hjl@gnu.org>
2329 * specific.c (pthread_key_delete): Check th->p_terminated to see
2330 if the thread is running.
2332 * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
2333 Added to GLIBC_2.0 for libc.so.
2335 1999-02-12 H.J. Lu <hjl@gnu.org>
2337 * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
2338 __libc_allocate_rtsig): Added to GLIBC_2.1.
2340 * internals.h (DEFAULT_SIG_RESTART): Removed.
2341 (DEFAULT_SIG_CANCEL): Removed.
2343 * pthread.c (init_rtsigs, __libc_current_sigrtmin,
2344 __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
2345 (__pthread_sig_restart, __pthread_sig_cancel,
2346 __pthread_sig_debug): Initialized.
2347 (pthread_initialize): Call init_rtsigs () to initialize
2350 1999-02-03 H.J. Lu <hjl@gnu.org>
2352 * manager.c (__pthread_manager): Do block __pthread_sig_debug.
2353 Don't restart the thread which sent REQ_DEBUG.
2354 (pthread_start_thread): Check if __pthread_sig_debug > 0
2357 * pthread.c (__pthread_initialize_manager): Suspend ourself
2358 after sending __pthread_sig_debug to gdb instead of
2359 __pthread_sig_cancel.
2361 1999-01-24 H.J. Lu <hjl@gnu.org>
2363 * manager.c (__pthread_manager): Delete __pthread_sig_debug
2364 from mask if __pthread_sig_debug > 0.
2365 (pthread_handle_create): Increment __pthread_handles_num.
2367 * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
2368 * pthread.c (__pthread_initialize_manager): Likewise.
2370 * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
2371 instead of __libc_allocate_rtsig (2).
2372 (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
2373 instead of __pthread_sig_cancel.
2374 (pthread_handle_sigdebug): Fix comments.
2376 1999-01-21 Ulrich Drepper <drepper@cygnus.com>
2378 * manager.c (pthread_allocate_stack): Set
2379 __pthread_nonstandard_stacks if user-specified stack is used.
2381 1999-01-16 Ulrich Drepper <drepper@cygnus.com>
2383 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
2384 _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
2386 1999-01-07 Xavier Leroy <Xavier.Leroy@inria.fr>
2388 * pthread.c: Use a third signal __pthread_sig_debug distinct
2389 from __pthread_sig_cancel to notify gdb when a thread is
2391 * manager.c: Likewise.
2392 * internals.h: Likewise.
2393 * signals.c: The implementation of sigwait(s) assumed that
2394 all signals in s have signal handlers already attached.
2395 This is not required by the standard, so make it work
2396 also if some of the signals have no handlers.
2398 1999-01-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
2400 * linuxthreads.texi: Remove pointers from first @node. Move old
2401 @node spec inside comment.
2403 1998-12-31 Ulrich Drepper <drepper@cygnus.com>
2405 * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
2408 1998-12-29 Ulrich Drepper <drepper@cygnus.com>
2410 * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
2411 lock. Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
2413 1998-12-21 Ulrich Drepper <drepper@cygnus.com>
2415 * manager.c: Threads now send __pthread_sig_cancel on termination.
2416 Change clone call and signal masks.
2417 * thread.c (pthread_handle_sigrestart): Remove special code for
2419 (pthread_handle_sigcancel): In manager thread call
2420 __pthread_manager_sighandler.
2421 * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
2422 * sysdeps/i386/i686/pt-machine.h: Likewise.
2423 Patches by Xavier Leroy.
2425 1998-12-14 Ulrich Drepper <drepper@cygnus.com>
2427 * spinlock.c (__pthread_unlock): Don't crash if called for an
2428 untaken mutex. Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
2430 * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
2433 1998-12-13 Ulrich Drepper <drepper@cygnus.com>
2435 * Examples/ex3.c: Wait until all threads are started before
2436 searching for the number to avoid race condition on very fast
2439 1998-12-08 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2441 * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
2442 declaration since it's not needed.
2444 * sysdeps/pthread/pthread.h: Move internal functions to ...
2445 * internals.h: ...here.
2447 1998-12-02 H.J. Lu <hjl@gnu.org>
2449 * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
2450 SIGRTMIN is defined.
2451 (__pthread_sig_cancel): Likewise.
2453 1998-12-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2455 * wrapsyscall.c: Include <sys/mman.h> for msync,
2456 <stdlib.h> for system and <termios.h> for tcdrain prototype.
2457 Correct msync declaration.
2459 1998-11-29 Roland McGrath <roland@baalperazim.frob.com>
2461 * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
2462 __libc_tsd_set): New macros for new interface.
2463 * no-tsd.c: New file, provide uninitialized defns of
2464 __libc_internal_tsd_get and __libc_internal_tsd_set.
2465 * Makefile (routines): Add no-tsd.
2467 1998-10-12 Roland McGrath <roland@baalperazim.frob.com>
2469 * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
2470 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2471 __libc_internal_tsd_set): Move decls to ...
2472 * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
2475 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2476 __libc_internal_tsd_set): Make these pointers to functions, not
2477 functions; remove #pragma weak decls for them.
2478 * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
2479 Define static functions and initialized pointers to them.
2481 1998-11-18 Ulrich Drepper <drepper@cygnus.com>
2483 * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
2484 (CFLAGS-specific.c): Likewise.
2485 (CFLAGS-pthread.c): Likewise.
2486 (CFLAGS-ptfork.c): Likewise.
2487 (CFLAGS-cancel.c): Likewise.
2488 * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
2489 as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
2491 * mutex.c (pthread_mutex_init): Define as strong symbol.
2492 (pthread_mutex_destroy): Likewise.
2493 (pthread_mutex_trylock): Likewise.
2494 (pthread_mutex_lock): Likewise.
2495 (pthread_mutex_unlock): Likewise.
2496 (pthread_mutexattr_init): Likewise.
2497 (pthread_mutexattr_destroy): Likewise.
2498 (pthread_once): Likewise.
2499 * ptfork.c (pthread_atfork): Likewise.
2500 * specific.c (pthread_key_create): Likewise.
2501 (pthread_setspecific): Likewise.
2502 (pthread_getspecific): Likewise.
2504 1998-11-15 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
2506 * linuxthreads.texi: Fix punctuation after xref.
2508 1998-11-10 H.J. Lu <hjl@gnu.org>
2510 * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
2511 if it is defined in <linux/limits.h>.
2513 1998-10-29 14:28 Ulrich Drepper <drepper@cygnus.com>
2515 * spinlock.h (__pthread_trylock): Define inline.
2516 (__pthread_lock): Add extra parameter to declaration. Declare
2517 using internal_function.
2518 (__pthread_unlock): Declare using internal_function.
2519 * spinlock.c (__pthread_lock): Add new parameter. Use it instead
2520 of local variable self. Avoid recomputing self. Define using
2522 (__pthread_trylock): Remove.
2523 (__pthread_unlock): Define using internal_function.
2524 * cancel.c: Adjust for __pthread_lock interface change. Use already
2525 computed self value is possible.
2526 * condvar.c: Likewise.
2528 * manager.c: Likewise.
2529 * mutex.c: Likewise.
2530 * pthread.c: Likewise.
2531 * rwlock.c: Likewise.
2532 * semaphore.c: Likewise.
2533 * signals.c: Likewise.
2535 1998-10-27 13:46 Ulrich Drepper <drepper@cygnus.com>
2537 * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
2538 __ to field names of the struct.
2539 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
2541 (pthread_attr_t): Likewise.
2542 (pthread_cond_t): Likewise.
2543 (pthread_condattr_t): Likewise.
2544 (pthread_mutex_t): Likewise.
2545 (pthread_mutexattr_t): Likewise.
2546 (pthread_rwlock_t): Likewise.
2547 (pthread_rwlockattr_t): Likewise.
2548 * attr.c: Adjust for pthread.h and pthreadtypes.h change.
2549 * cancel.c: Likewise.
2550 * condvar.c: Likewise.
2551 * manager.c: Likewise.
2552 * mutex.c: Likewise.
2553 * pthread.c: Likewise.
2554 * ptlongjmp.c: Likewise.
2555 * rwlock.c: Likewise.
2556 * spinlock.c: Likewise.
2558 1998-10-09 Ulrich Drepper <drepper@cygnus.com>
2560 * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
2563 * sysdeps/i386/i686/pt-machine.h: Remove unused inline
2566 * Makefile (libpthread-routines): Add pt-machine.
2567 * pt-machine.c: New file.
2568 * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
2569 yet defined. Use PT_EI in extern inline definitions.
2570 * sysdeps/arm/pt-machine.h: Likewise.
2571 * sysdeps/i386/pt-machine.h: Likewise.
2572 * sysdeps/i386/i686/pt-machine.h: Likewise.
2573 * sysdeps/m68k/pt-machine.h: Likewise.
2574 * sysdeps/mips/pt-machine.h: Likewise.
2575 * sysdeps/powerpc/pt-machine.h: Likewise.
2576 * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
2577 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2579 1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2581 * semaphore.h: Include <sys/types.h> so that _pthread_descr
2584 1998-09-15 David S. Miller <davem@pierdol.cobaltmicro.com>
2586 * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
2588 * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
2590 1998-09-12 14:24 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2592 * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
2595 1998-09-02 11:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2597 * signals.c (sigaction): Check that sig is less than NSIG to avoid
2598 array index overflow.
2600 1998-09-06 10:56 Ulrich Drepper <drepper@cygnus.com>
2602 * sysdeps/pthread/semaphore.h: New file.
2604 1998-09-06 09:08 Ulrich Drepper <drepper@cygnus.com>
2606 * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
2607 _LIBC_TSD_KEY_DL_ERROR.
2609 1998-08-31 Ulrich Drepper <drepper@cygnus.com>
2611 * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
2612 * sysdeps/i386/pt-machine.h: Likewise.
2613 Suggested by Roland McGrath.
2615 1998-08-28 13:58 Ulrich Drepper <drepper@cygnus.com>
2617 * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
2618 access thread data with non-constant offsets.
2619 * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
2622 * sysdeps/i386/useldt.h: Fix typo. Add THREAD_GETMEM_NC and
2623 THREAD_SETMEM_NC definitions.
2625 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
2627 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2629 1998-08-26 15:46 Ulrich Drepper <drepper@cygnus.com>
2631 * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
2632 not already defined.
2633 (struct _pthread_descr_struct): Add p_self and p_nr field.
2634 * manager.c (__pthread_handles): Define second element to point
2636 (__pthread_handles_num): Initialize to 2.
2637 (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
2638 (pthread_start_thread): Likewise.
2639 (pthread_handle_create): Start search for free slot at entry 2.
2640 Initialize new fields p_self and p_nr.
2641 Call __clone with CLONE_PTRACE if available.
2642 (pthread_free): Call FREE_THREAD_SELF if available.
2643 * pthread.c (__pthread_initial_thread): Initialize new fields.
2644 (__pthread_manager_thread): Likewise.
2645 (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
2647 * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
2648 elements of the thread descriptor.
2649 * condvar.c: Likewise.
2650 * errno.c: Likewise.
2652 * manager.c: Likewise.
2653 * pthread.c: Likewise.
2654 * ptlongjmp.c: Likewise.
2655 * semaphore.c: Likewise.
2656 * signals.c: Likewise.
2657 * specific.c: Likewise.
2658 * spinlock.c: Likewise.
2660 * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
2662 * sysdeps/i386/useldt.h: New file.
2663 * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
2665 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
2666 THREAD_SETMEM using __thread_self.
2667 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2669 1998-08-24 Geoff Keating <geoffk@ozemail.com.au>
2671 * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
2672 turned out that we didn't need to queue after all.
2674 1998-08-22 Geoff Keating <geoffk@ozemail.com.au>
2676 * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
2677 and wastes space; correct types.
2679 1998-08-08 11:18 H.J. Lu <hjl@gnu.org>
2681 * signals.c (sigaction): Handle NULL argument.
2683 1998-08-04 Ulrich Drepper <drepper@cygnus.com>
2685 * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
2688 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2690 * Makefile (linuxthreads-version): Extract correct number from
2693 1998-07-29 Xavier Leroy <Xavier.Leroy@inria.fr>
2695 * Banner: Bump version number to 0.8
2696 * FAQ.html: Many updates, in particular w.r.t. debugging.
2697 * manager.c: Support for non-default stacksize for
2698 LinuxThreads-allocated stacks;
2699 don't use guard pages for stacks with default size, rely on
2700 rlimit(RLIMIT_STACK) instead (it's cheaper).
2702 * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
2703 everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
2704 * condvar.c: Likewise.
2705 * internals.h: Likewise.
2706 * restart.h: Likewise.
2707 * signals.c: Likewise.
2708 * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
2710 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2712 * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
2713 __pthread_mutexattr_[sg]ettype. Add more weak aliases.
2714 * Versions: Put __pthread_mutexattr_settype under version
2715 GLIBC_2.0. Don't export __pthread_mutexattr_setkind_np and
2716 __pthread_mutexattr_gettype.
2718 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2720 * sysdeps/pthread/bits/libc-lock.h: Make
2721 __pthread_mutexattr_settype weak. Don't make
2722 __pthread_mutexattr_setkind_np weak.
2724 1998-07-16 10:52 Ulrich Drepper <drepper@cygnus.com>
2726 * manager.c (pthread_handle_create): Check whether sched_setscheduler
2727 call can succeed here.
2729 * mutex.c: Define __pthread_mutexattr_settype and make
2730 __pthread_mutexattr_setkind_np an alias.
2731 Likewise for __pthread_mutexattr_gettype.
2733 1998-07-15 11:00 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2735 * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
2738 1998-07-14 19:38 Ulrich Drepper <drepper@cygnus.com>
2740 * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
2742 1998-07-11 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2744 * Examples/ex6.c: Include <unistd.h> for usleep.
2746 1998-06-13 11:04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2748 * Examples/ex4.c (main): Use exit, not pthread_exit.
2750 1998-07-09 13:39 Ulrich Drepper <drepper@cygnus.com>
2752 * Versions: Add __pthread_mutexattr_gettype and
2753 __pthread_mutexattr_settype.
2754 * lockfile.c: Use __pthread_mutexattr_settype instead of
2755 __pthread_mutexattr_setkind_np.
2756 * mutex.c: Define __pthread_mutexattr_gettype and
2757 __pthread_mutexattr_settype.
2759 * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
2760 __pthread_mutexattr_settype.
2761 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
2762 Use __pthread_mutexattr_settype.
2764 1998-07-08 22:26 Ulrich Drepper <drepper@cygnus.com>
2766 * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
2767 * mutex.c: Define weak alias pthread_mutexattr_gettype and
2768 pthread_mutexattr_settype.
2769 * sysdeps/pthread/pthread.h: Declare these functions.
2770 Move pthread_sigmask and pthread_kill declaration in separate header.
2771 * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
2773 1998-07-07 15:20 Ulrich Drepper <drepper@cygnus.com>
2775 * Makefile: Add rules to compile and run tests.
2776 * Examples/ex1.c: Little changes to fix warnings.
2777 * Examples/ex2.c: Likewise.
2778 * Examples/ex3.c: Likewise.
2779 * Examples/ex4.c: Likewise.
2780 * Examples/ex5.c: Likewise.
2781 * Examples/ex6.c: New file.
2783 1998-07-05 11:54 Ulrich Drepper <drepper@cygnus.com>
2785 * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
2787 1998-07-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2789 * attr.c: Include <string.h>.
2791 1998-06-30 11:47 Ulrich Drepper <drepper@cygnus.com>
2793 * attr.c: Include errno.h. Use memcpy to copy sched_param.
2794 * internals.h: Include limits.h.
2795 * manager.c: Use memcpy to copy sched_param.
2796 * ptfork.c: Include errno.h.
2797 * pthread.c: Likewise.
2798 * semaphore.c: Likewise.
2799 * specific.c: Likewise.
2800 * spinlock.h: Likewise.
2801 * sysdeps/pthread/pthread.h: Include only allowed headers. Move
2802 type definition to ...
2803 * sysdeps/pthread/bits/pthreadtypes.h: ...here. New file.
2805 1998-06-29 12:34 Ulrich Drepper <drepper@cygnus.com>
2807 * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
2809 * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
2810 as macros as demanded in POSIX.1, Annex C.
2812 1998-06-29 12:29 Ulrich Drepper <drepper@cygnus.com>
2814 * internals.h (struct pthread_request): For free use pthread_t
2815 instead of pthread_descr.
2816 * join.c (pthread_join): Pass thread_id, not th to manager.
2817 (pthread_detach): Likewise.
2818 * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
2819 (pthread_exited): Remove detached queue code.
2820 (pthread_handle_free): Expect thread ID parameter and use it to
2821 validate the thread decsriptor. Don't use detached queue.
2822 Patches by Xavier Leroy.
2824 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2826 * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
2827 _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
2828 __pthread_atfork, __pthread_key_create, __pthread_once.
2829 * internals.h: Doc fix.
2830 * pthread.c (__pthread_initialize): Define again.
2832 1998-06-26 Ulrich Drepper <drepper@cygnus.com>
2834 * manager.c (pthread_exited): If thread is not detached put it on
2836 (pthread_handle_free): If thread is not on list with living threads
2837 search on list with detached threads.
2839 * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
2840 for new definition of pthread_rwlock_t.
2842 * spinlock.c: Correct test whether to compile
2843 __pthread_compare_and_swap or not.
2845 1998-06-25 19:27 Ulrich Drepper <drepper@cygnus.com>
2847 * attr.c: Finish user stack support. Change locking code to be safe
2848 in situations with different priorities.
2849 * cancel.c: Likewise.
2850 * condvar.c: Likewise.
2851 * internals.h: Likewise.
2853 * manager.c: Likewise.
2854 * mutex.c: Likewise.
2855 * pthread.c: Likewise.
2856 * ptlongjmp.c: Likewise.
2857 * queue.h: Likewise.
2858 * rwlock.c: Likewise.
2859 * semaphore.c: Likewise.
2860 * semaphore.h: Likewise.
2861 * signals.c: Likewise.
2862 * spinlock.c: Likewise.
2863 * spinlock.h: Likewise.
2864 * sysdeps/pthread/pthread.h: Likewise.
2865 Patches by Xavier Leroy.
2867 * sysdeps/i386/i686/pt-machine.h: New file.
2869 1998-06-25 Ulrich Drepper <drepper@cygnus.com>
2871 * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
2872 [sg]et_stackaddr prototypes always available.
2874 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2875 _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
2877 1998-06-24 Ulrich Drepper <drepper@cygnus.com>
2879 * manager.c (pthread_free): Undo patch from 980430.
2880 Reported by David Wragg <dpw@doc.ic.ac.uk>.
2882 1998-06-09 15:07 Ulrich Drepper <drepper@cygnus.com>
2884 * manager.c: Define __pthread_manager_adjust_prio and use it to
2885 increase priority when needed.
2886 * internals.h: Add prototype for __pthread_manager_adjust_prio.
2887 * mutex.c: Optimize mutexes to wake up only one thread.
2888 * pthread.c: Move PID of manager for global variable in structure
2890 Patches by Xavier Leroy.
2892 1998-06-07 13:47 Ulrich Drepper <drepper@cygnus.com>
2894 * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
2896 1998-06-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2898 * attr.c: Correct typo.
2900 1998-05-01 Ulrich Drepper <drepper@cygnus.com>
2902 * manager.c (pthread_free): Unmap guard before the stack.
2903 Patch by Matthias Urlichs.
2905 1998-04-30 Ulrich Drepper <drepper@cygnus.com>
2907 * manager.c (pthread_free): Detect already free child.
2908 Patch by Xavier Leroy, reported by Matthias Urlichs.
2910 1998-04-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2912 * Makefile (linuxthreads-version): Renamed back from
2915 1998-04-21 Ulrich Drepper <drepper@cygnus.com>
2917 * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
2920 1998-04-20 14:55 Ulrich Drepper <drepper@cygnus.com>
2922 * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
2923 * internals.h: Add definitions for new spinlock implementation.
2924 * ptlongjmp.c: New file.
2925 * spinlock.c: New file.
2926 * spinlock.h (acquire): Don't reschedule using __sched_yield, use
2927 new function __pthread_acquire to prevent deadlocks with thread
2928 with different priorities.
2929 Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
2931 1998-03-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2933 * manager.c (__pthread_manager): Reduce first argument to select
2934 to include just the needed file descriptor.
2936 1998-03-17 00:06 Ulrich Drepper <drepper@cygnus.com>
2938 * manager.c: Fix last patch which caused core dumps.
2940 * pthread.c: Correctly handle missing SIGRTMIN.
2942 1998-03-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2944 * libpthread.map: Add __libc_internal_tsd_get and
2945 __libc_internal_tsd_set. Add missing cancelable functions. Export
2946 libc internal versions of the cancelable functions.
2948 1998-03-13 16:51 Ulrich Drepper <drepper@cygnus.com>
2950 * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
2952 1998-03-13 00:46 Ulrich Drepper <drepper@cygnus.com>
2954 * attr.c: Implement pthread_attr_[gs]etguardsize,
2955 pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
2956 Change pthread_attr_init to have two interfaces.
2957 * internals.h (struct _pthread_descr_struct): Add new fields for
2959 * libpthread.map: Add names in GLIBC_2.1 section.
2960 * manager.c (pthread_handle_create): Implement guardsize and
2962 (pthread_free): Likewise.
2963 * pthread.c (pthread_create): Add new interface for changed
2965 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2966 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
2969 1998-03-11 00:42 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
2971 * manager.c: Enable resetting of the thread scheduling policy
2972 to SCHED_OTHER when the parent thread has a different one.
2974 1998-02-01 13:51 Ulrich Drepper <drepper@cygnus.com>
2976 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2977 _POSIX_ASYNCHRONOUS_IO.
2979 * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
2981 * mutex.c: Implement new mutex types.
2983 * internals.h: Include <signal.h>.
2985 * libpthread.map: Add __erno_location and __h_errno_location.
2987 * errno.c: Return pointer to variable actually in use. This might
2988 not be the one in the thread structure.
2989 * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
2991 * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
2992 of manager thread structure.
2993 (pthread_handle_create): Set p_errnop and p_h_errnop members for new
2995 * pthread.c: Adapt initializer for thread structures.
2996 (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
2997 (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
2998 current thread to global variables.
3000 1998-01-31 17:27 Ulrich Drepper <drepper@cygnus.com>
3002 * rwlock.c: New file.
3003 * Makefile (libpthread-routines): Add rwlock.
3004 * sysdeps/pthread/pthread.h: Define data structures and declare
3006 * libpthread.map: Add new functions.
3008 1997-12-18 13:50 Philip Blundell <pb@nexus.co.uk>
3010 * sysdeps/arm/pt-machine.h: New file; add ARM support.
3011 * sysdeps/arm/Implies: likewise.
3012 * README: Document it.
3014 1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3016 * signals.c: Remove unneeded initializer for sigwaited, saving a
3019 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3021 * semaphore.c (sem_init): Set sem_spinlock only if available.
3023 1997-12-04 01:48 Ulrich Drepper <drepper@cygnus.com>
3025 * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3026 * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3028 * Makefile: Update from LinuxThreads 0.7.
3029 * internals.h. Likewise.
3030 * manager.c: Likewise.
3031 * mutex.c: Likewise.
3032 * pthread.c: Likewise.
3033 * signals.c: Likewise.
3034 * specific.c: Likewise.
3035 * Examples/ex3.c: Likewise.
3037 1997-11-20 18:13 Ulrich Drepper <drepper@cygnus.com>
3039 * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3042 1997-10-29 05:38 Ulrich Drepper <drepper@cygnus.com>
3044 * wrapsyscall.c: Add socket functions which are also cancelation
3047 1997-10-19 21:40 Wolfram Gloger <wg@wolfram.dent.med.uni-muenchen.de>
3049 * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
3050 New functions for fast thread specific data within libc.
3052 * internals.h: Add new array p_libc_specific to struct
3053 _pthread_descr_struct.
3055 * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
3057 1997-10-13 05:39 Ulrich Drepper <drepper@cygnus.com>
3059 * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
3060 Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
3062 1997-08-29 03:05 Ulrich Drepper <drepper@cygnus.com>
3064 * internals.h (struct _pthread_descr_struct): Add definitions for
3065 two-level specific key handling.
3066 * manager.c (pthread_handle_create): Initialize specific memory array.
3067 * specific.c: Implement two-level key handling.
3068 * weaks.c: Don't provide dummy key handling.
3069 * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
3070 Add definition of __libc_key_t.
3071 * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
3073 Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
3074 PTHREAD_DESTRUCTOR_ITERATIONS.
3076 * manager.c (pthread_handle_create): Compare mmap result with
3079 * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
3080 * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
3082 1997-08-22 19:04 Richard Henderson <rth@cygnus.com>
3084 sysdeps/sparc -> sysdeps/sparc/sparc32
3085 sysdeps/sparc64 -> sysdeps/sparc/sparc64
3087 * internals.h: Change definition of THREAD_SELF to be an expression,
3088 not a statement that did a return.
3089 * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
3090 * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
3091 Follow Solaris and use a "system reserved" register (%g6) to hold
3092 the thread descriptor.
3093 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3095 1997-08-03 00:09 Ulrich Drepper <drepper@cygnus.com>
3097 * mutex.c: Correct pthread_once. Patch by Xavier Leroy.
3098 * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
3099 * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
3101 * semaphore.c: Include spinlock.h only when needed.
3103 * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
3104 keys for entries not in use.
3106 * weaks.c: Implement key handling functions for real.
3108 1997-06-29 01:04 Richard Henderson <richard@gnu.ai.mit.edu>
3110 Initial sparc64-linux support:
3111 * sysdeps/sparc64/Implies: New file.
3112 * sysdeps/sparc64/pt-machine.h: Likewise.
3114 1997-06-29 00:48 Ulrich Drepper <drepper@cygnus.com>
3116 * semaphore.c: Include spinlock.h at correct place.
3119 1997-06-13 10:06 Richard Henderson <rth@tamu.edu>
3121 The Great Bit File Move:
3122 * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
3123 * sysdeps/powerpc/semaphorebits.h: Likewise.
3124 * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
3125 * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
3126 * sysdeps/pthread/libc-lock.h: -> bits/
3127 * sysdeps/pthread/stdio-lock.h: Likewise.
3128 * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
3129 * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
3130 * semaphore.h: Likewise.
3131 * sysdeps/pthread/pthread.h: Likewise.
3133 * lockfile.c: <foo.h> -> <bits/foo.h>.
3134 * semaphore.h: Likewise.
3136 * Makefile: (headers): foo.h -> bits/foo.h.
3137 * sysdeps/pthread/Makefile: Likewise.
3139 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3141 * semaphore.c (sem_init): Set sem_spinlock only if available.
3143 * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
3146 1997-04-09 03:00 Ulrich Drepper <drepper@cygnus.com>
3148 Update from LinuxThreads 0.6.
3150 * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
3151 and __sched_get_priority_min instead of names without `__'.
3153 * manager.c: Rewrite large parts to implement opaque pthread_t.
3155 * cancel.c: Adapt for opaque pthread_t type.
3156 * condvar.c: Likewise.
3157 * errno.c: Likewise.
3159 * mutex.c: Likewise.
3160 * pthread.c: Likewise.
3161 * signals.c: Likewise.
3162 * specific.c: Likewise.
3163 * restart.h: Likewise.
3164 * queue.h: Likewise.
3165 * Examples/ex3.c: Likewise.
3166 * Examples/ex4.c: Likewise.
3167 * sysdeps/pthread/pthread.h: Likewise.
3169 * pthread.c: Accumulate time for all threads in thread manager.
3171 * semaphore.c: Implement fallback implementation for architectures
3172 sometimes missing compare-exchange operations.
3174 * cancel.c (pthread_cancel): Validate handle argument.
3175 * join.c (pthread_join): Likewise.
3176 (pthread_detach): Likewise.
3177 * signals.c (pthread_kill): Likewise.
3179 * spinlock.h (acquire): Use __sched_yield not sched_yield.
3181 * queue.h (enqueue): Enqueue thread according to priority.
3183 * internals.c (struct pthread_start_args): New struct for passing
3184 args to cloning function.
3185 (struct _pthread): Rename to _pthread_descr_struct and adapt for
3188 * Examples/Makefile (clean): Pass -f option to rm.
3190 * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
3191 and define TEST_FOR_COMPARE_AND_SWAP.
3192 * sysdeps/i386/i486/pt-machine.h: Removed.
3194 * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
3197 1997-04-04 16:38 Ulrich Drepper <drepper@cygnus.com>
3199 * restart.h (suspend): Clear p_signal before suspending.
3200 (suspend_with_cancellation): Likewise.
3201 Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
3203 * weaks.c: Make __pthread_key_create return 1.
3204 * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
3205 __libc_getspecific, __libc_setspecific, and __libc_key_t.
3206 * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
3209 1997-03-19 15:13 Miguel de Icaza <miguel@nuclecu.unam.mx>
3211 * sysdeps/sparc/pt-machine (RELEASE): Fix.
3213 1997-03-01 07:55 Geoff Keating <geoffk@ozemail.com.au>
3215 * sysdeps/powerpc/Implies: Added.
3216 * sysdeps/powerpc/pt-machine.h: Added.
3217 * sysdeps/powerpc/semaphorebits.h: Added.
3219 1997-01-22 01:22 Ulrich Drepper <drepper@cygnus.com>
3221 * pthread.c (__pthread_initial_thread): Correct
3223 (__pthread_manager_thread): Likewise.
3224 Reported by Andreas Jaeger.
3226 1997-01-18 22:15 Richard Henderson <rth@tamu.edu>
3228 Since sigset_t no longer fits in a register, we can't pass in the
3229 thread's initial mask so easily. Take this opportunity to simplify
3230 the clone implementation by only accepting a single void* argument.
3232 * manager.c (__pthread_manager): Put thread vitals in the thread
3233 struct instead of as arguments through clone.
3234 (pthread_start_thread): Look for them there.
3235 * internals.h (struct _pthread): Add p_initial_fn,
3236 p_initial_fn_arg, p_initial_mask. Fix __pthread_manager proto.
3237 * pthread.c (pthread_initialize_manager): Revise clone invocation.