1 2001-07-26 kaz Kojima <kkojima@rr.iij4u.or.jp>
3 * sysdeps/sh/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF): Defined.
5 2001-07-24 Ulrich Drepper <drepper@redhat.com>
7 * tst-context.c (main): Print explanation before bailing out
8 because context handling is not supported.
10 2001-07-23 Ulrich Drepper <drepper@redhat.com>
12 * Makefile (tests): Add tst-context.
13 * tst-context.c: New file.
15 * sysdeps/pthread/bits/stdio-lock.h: Define
16 _IO_cleanup_region_start_noarg.
18 2001-07-23 Jakub Jelinek <jakub@redhat.com>
20 * sysdeps/alpha/pt-machine.h (FLOATING_STACKS): Define.
21 (ARCH_STACK_MAX_SIZE): Define.
22 * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
23 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
25 2001-07-19 Jakub Jelinek <jakub@redhat.com>
27 * sysdeps/i386/useldt.h: Fix typo in ARCH_STACK_MAX_SIZE comment.
29 * sysdeps/ia64/pt-machine.h (FLOATING_STACKS): Define.
30 (ARCH_STACK_MAX_SIZE): Define.
31 * manager.c (pthread_allocate_stack): Handle FLOATING_STACKS with
32 NEED_SEPARATE_REGISTER_STACK.
34 2001-07-16 Andreas Schwab <schwab@suse.de>
36 * Makefile (before-compile): Don't add $(objpfx)crti.o.
37 (omit-deps): Add crti.
38 ($(objpfx)libpthread.so): Depend on $(objpfx)crti.o, but make sure
39 it is filtered out of the link command.
41 2001-07-16 Ulrich Drepper <drepper@redhat.com>
43 * pthread.c (pthread_initialize): For FLOATING_STACKS don't bother
44 to find the right value for __pthread_initial_thread_bos, it's not
45 used. If not FLOATING_STACKS first run
46 __pthread_init_max_stacksize.
48 2001-06-16 H.J. Lu <hjl@gnu.org>
50 * internals.h: Include <stackinfo.h>.
52 * attr.c: Don't include <stackinfo.h> here.
54 * manager.c: Likewise.
55 * pthread.c: Likewise.
56 * ptlongjmp.c: Likewise.
58 2001-03-23 Matthew Wilcox <willy@ldl.fc.hp.com>
60 * attr.c: Make _STACK_GROWS_UP work.
61 * internals.h: Likewise.
62 * manager.c: Likewise.
63 * pthread.c: Likewise.
65 2001-06-15 H.J. Lu <hjl@gnu.org>
67 * pthread.c (__pthread_reset_main_thread): Fix a typo.
69 2001-02-02 John S. Marvin <jsm@udlkern.fc.hp.com>
71 * semaphore.h: Use struct _pthread_fastlock as an element of
72 sem_t instead of an identical struct.
73 * rwlock.c: Remove casts.
74 * semaphore.c: Likewise.
76 2001-04-30 Alan Modra <amodra@one.net.au>
78 * sysdeps/unix/sysv/linux/hppa/pt-initfini.c: New.
80 2001-05-25 Bruce Mitchener <bruce@cubik.org>
82 * linuxthreads.texi: Spelling corrections.
84 2001-05-25 Ulrich Drepper <drepper@redhat.com>
86 * oldsemaphore.c (__old_sem_wait): Clear p_nextwaiting before
87 returning successfully.
88 Patch by Gene Cooperman <gene@ccs.neu.edu>.
90 2001-05-24 Ulrich Drepper <drepper@redhat.com>
92 * spinlock.c (__pthread_lock) [HAS_COMPARE_AND_SWAP]: Before doing any
93 serious work try once whether the lock is uncontested.
94 Remove duplicate reading of __status before loop.
95 Change suggested by Hans Boehm <hans_boehm@hp.com>.
97 * spinlock.h (__pthread_trylock): Remove need for oldstatus variable.
98 (__pthread_alt_trylock): Likewise.
100 2001-05-01 Kaz Kylheku <kaz@ashi.footprints.net>
102 Memory barrier overhaul following line by line inspection.
103 * mutex.c (pthread_once): Missing memory barriers added.
104 * pthread.c (__pthread_wait_for_restart_signal,
105 __pthread_timedsuspend_new, __pthread_restart_new): Added
106 memory barriers ``just in case'' and for documentary value.
107 * spinlock.c (__pthread_release): New inline function for releasing
108 spinlock, to complement __pthread_acquire. Includes memory
109 barrier prior to assignment to spinlock, and __asm __volatile
110 dance to prevent reordering or optimization of the spinlock access.
111 * spinlock.c (__pthread_unlock, __pthread_alt_lock,
112 __pthread_alt_timedlock, __pthread_alt_unlock,
113 __pthread_compare_and_swap): Updated to use new __pthread_release
114 instead of updating spinlock directly.
115 * spinlock.c (__pthread_lock, __pthread_unlock, wait_node_alloc,
116 wait_node_free, wait_node_dequeue, __pthread_alt_lock,
117 __pthread_alt_timedlock, __pthread_alt_unlock, __pthread_acquire):
118 Memory barrier overhaul. Lots of missing memory barriers added,
119 a couple needless ones removed.
120 * spinlock.c (__pthread_compare_and_swap): testandset optimization
121 removed, just calls __pthread_acquire, which has the new read
122 barrier in it before its testandset.
124 2001-05-20 Roland McGrath <roland@frob.com>
126 * Makeconfig: New file, variables used to be in main libc Makeconfig.
128 2001-05-09 Geoff Keating <geoffk@redhat.com>
130 * sysdeps/powerpc/pt-machine.h
131 (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): Define.
132 (__compare_and_swap): Remove memory barriers.
133 (__compare_and_swap_with_release_semantics): New function.
135 2001-04-24 Andreas Jaeger <aj@suse.de>
137 * wrapsyscall.c: send* and recv* return ssize_t.
139 * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Unlock the
140 mutex instead of double locking it.
141 Reported by Pierre Artaud <partaud@sodatec.com>.
143 2001-04-23 Ulrich Drepper <drepper@redhat.com>
145 * sysdeps/pthread/getcpuclockid.c: Make function generic, test
146 using #ifdef whether the clock is available.
147 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: Removed.
149 * sysdeps/ia64/Versions: New file.
151 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init): We don't
152 have to call __gmon_start__ in the libpthread DSO.
153 * sysdeps/pthread/pt-initfini.c (_init): Likewise.
155 * Makefile (libpthread-routines): Add ptclock_gettime and
157 * internals.h: Don't use cpuclock-init.h definitions, use
158 hp-timing.h definitions.
159 * pthread.c: Likewise.
160 * manager.c: Likewise.
161 * ptclock_gettime.c: New file.
162 * ptclock_settime.c: New file.
163 * internals.h: Fix parameter type for __pthread_clock_gettime and
164 __pthread_clock_settime.
166 * sysdeps/i386/i586/ptclock_gettime.c: Removed.
167 * sysdeps/i386/i586/ptclock_settime.c: Removed.
168 * sysdeps/i386/i586/Makefile: Removed.
170 2001-04-22 Ulrich Drepper <drepper@redhat.com>
172 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_ASYNCH_IO.
173 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
175 2001-04-21 Andreas Jaeger <aj@suse.de>
177 * sysdeps/pthread/timer_routines.c (thread_func): Add noreturn
178 attribute, remove statements that will never be executed.
179 (thread_func): Remove mutex_unlock call since it's never executed.
180 (thread_func): Fix comment as suggested by Jakub Jelinek.
182 * manager.c (__pthread_manager): Add noreturn
184 (pthread_start_thread): Likewise, remove return statement.
185 (pthread_start_thread_event): Likewise.
186 Add noreturn attribute for pthread_handle_exit.
187 * weaks.c: Add noreturn attribute for pthread_exit.
189 * internals.h: Add __pthread_clock_gettime and
190 __pthread_clock_settime prototypes.
192 2001-04-21 Ulrich Drepper <drepper@redhat.com>
194 * internals.h: Include <cpuclock-init.h>.
195 (struct _pthread_descr_struct): Add p_cpuclock_offset field if
196 CPUCLOCK_VARDEF is defined.
197 * pthread.c (__pthread_initialize_minimal): Initialize
198 p_cpuclock_offset field for main thread if CPUCLOCK_INIT is defined.
199 * manager.c (pthread_start_thread): Set p_cpuclock_offset field
200 for new thread to current CPU clock value.
202 * sysdeps/i386/useldt.h: Extend all the macros to handle 8-byte values.
204 * sysdeps/i386/i586/Makefile: New file.
205 * sysdeps/i386/i586/Versions: New file.
206 * sysdeps/i386/i586/ptclock_gettime.c: New file.
207 * sysdeps/i386/i586/ptclock_settime.c: New file.
208 * sysdeps/i386/i686/Implies: New file.
210 2001-04-18 Jakub Jelinek <jakub@redhat.com>
212 * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Put specs into
213 $generated, not $postclean-generated.
215 2001-04-18 Andreas Jaeger <aj@suse.de>
217 * Makefile (otherlibs): Added.
219 2001-04-18 Jakub Jelinek <jakub@redhat.com>
221 * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
223 2001-04-16 Ulrich Drepper <drepper@redhat.com>
225 * signals.c (sigwait): NSIG is no signal number. Block all
226 signals while in signal handler for signals in SET.
227 Patch by Manfred Spraul <manfred@colorfullife.com>.
229 2001-04-12 Ulrich Drepper <drepper@redhat.com>
231 * tst-cancel.c: Disable most tests. Add new test where all
232 cleanup handlers must run.
233 * Makefile (tests): Add tst-cancel again.
235 * cancel.c (__pthread_perform_cleanup): Correct condition for
236 leaving cleanup loop early.
238 * sysdeps/i386/Makefile: Make sure gcc uses a frame pointer for
239 all the files which use CURRENT_STACK_FRAME.
240 * sysdeps/i386/pt-machine.h (CURRENT_STACK_FRAME): Define using
241 __builtin_frame_address.
242 * sysdeps/i386/i686/pt-machine.h: Likewise.
244 2001-04-11 Ulrich Drepper <drepper@redhat.com>
246 * Makefile (tests): Comment out tst-cancel for now.
248 * tst-cancel.c (main): Cleanup 4 is supposed to run. Create
249 temporary file in object directory.
250 * Makefile: Don't allow inlining when compiling tst-cancel.c.
251 Pass $(objpfx) to tst-cancel.
253 2001-04-11 David S. Miller <davem@redhat.com>
255 * sysdeps/sparc/sparc32/pt-machine.h (stack_pointer): Advance
256 up closer to user local variables so that new cleanup heuristics work.
257 * sysdeps/sparc/sparc64/pt-machine.h (stack_pointer): Likewise.
259 2001-04-11 Ulrich Drepper <drepper@redhat.com>
261 * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
263 (_pthread_cleanup_push_defer): Likewise.
265 * tst-cancel.c (main): Fix loop printing cleanup output.
267 2001-04-10 kaz Kojima <kkojima@rr.iij4u.or.jp>
269 * sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
271 (__pthread_spin_trylock): Likewise.
272 * sysdeps/sh/pt-machine.h (testandset): Likewise.
274 2001-04-10 Ulrich Drepper <drepper@redhat.com>
276 * join.c (pthread_exit): Move code to new function __pthread_do_exit
277 which takes an extra parameter with the current frame pointer.
278 Call new function with CURRENT_STACK_FRAME.
279 (__pthread_do_exit): New function. Call __pthread_perform_cleanup
280 with the new parameter.
281 (pthread_join): Call __pthread_do_exit instead of pthread_exit.
282 * cancel.c (__pthread_perform_cleanup): Takes extra parameter. Use
283 this parameter as the initial value the cleanup handler records are
284 compared against. No active cleanup handler record must have an
285 address lower than the previous one and the initial record must be
286 above (below on PA) the frame address passed in.
287 (pthread_setcancelstate): Call __pthread_do_exit instead of
289 (pthread_setcanceltype): Likewise.
290 (pthread_testcancel): Likewise.
291 (_pthread_cleanup_pop_restore): Likewise.
292 * condvar.c (pthread_cond_wait): Likewise.
293 (pthread_cond_timedwait_relative): Likewise.
294 * manager.c (pthread_start_thread): Likewise.
295 * oldsemaphore.c (__old_sem_wait): Likewise.
296 * pthread.c (pthread_handle_sigcancel): Likewise.
297 * semaphore.c (__new_sem_wait): Likewise.
298 (sem_timedwait): Likewise.
299 * ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
300 to limit the cleanup handlers which get run.
301 * internals.h: Add prototype for __pthread_do_exit. Adjust prototype
302 for __pthread_perform_cleanup.
304 * Makefile (tests): Add tst-cancel.
305 * tst-cancel.c: New file.
307 2001-04-08 Hans-Peter Nilsson <hp@axis.com>
309 * sysdeps/cris/pt-machine.h: New file.
310 * sysdeps/cris/pspinlock.c: New file.
312 2001-04-09 Hans-Peter Nilsson <hp@axis.com>
314 * shlib-versions: Add case for Linux on CRIS.
316 2001-03-26 Ulrich Drepper <drepper@redhat.com>
318 * attr.c (pthread_getattr_np): Correct computation of stack size
319 for machiens with register stack.
321 * Examples/ex17.c (main): Correct detection of failed mmap call.
323 2001-03-21 Jakub Jelinek <jakub@redhat.com>
325 * pthread.c (__pthread_initialize_manager): Fix a typo.
327 2001-03-21 Jakub Jelinek <jakub@redhat.com>
329 * attr.c (__pthread_attr_setstack): Fix alignment check.
330 (pthread_getattr_np): __stackaddr is top of stack, not bottom.
331 * Makefile (tests): Add ex17 test.
332 * Examples/ex17.c: New test.
334 2001-03-20 Ulrich Drepper <drepper@redhat.com>
336 * Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
337 * cancel.c (__pthread_perform_cleanup): Call __rpc_thread_destroy.
338 * sysdeps/pthread/bits/libc-tsd.h: Define _LIBC_TSD_KEY_VARS.
340 2001-03-18 Ulrich Drepper <drepper@redhat.com>
342 * Makefile: When generating DSO link with libc_nonshared.a.
344 2001-02-26 Jakub Jelinek <jakub@redhat.com>
346 * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
348 2001-02-23 Jakub Jelinek <jakub@redhat.com>
350 * internals.h (__pthread_init_max_stacksize): New prototype.
351 * attr.c (__pthread_attr_setstacksize): Call
352 __pthread_init_max_stacksize if not yet initialized.
353 * pthread.c (__pthread_init_max_stacksize): New function.
354 (__pthread_initialize_manager): Call it.
355 Patch by <dtc@cmucl.cons.org>.
357 2001-03-16 Ulrich Drepper <drepper@redhat.com>
359 * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
361 2001-03-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
363 * shlib-versions: Add rule for Linux on 64 bit S/390.
364 * sysdeps/s390/s390-64/pt-machine.h: New file.
365 * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
367 2001-03-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
369 * sysdeps/s390/pt-machine.h: Move to...
370 * sysdeps/s390/s390-32/pt-machine.h: ...here.
371 Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
373 2001-03-15 Ulrich Drepper <drepper@redhat.com>
375 * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
376 * attr.c: Implement pthread_getattr_np.
377 * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
378 * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
379 * manager.c (pthread_handle_create): Initialize p_inheritsched.
381 2001-03-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
383 * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
386 2001-02-20 Hans Boehm <hans_boehm@hp.com>
388 * manager.c (manager_mask): Removed static vesion. Now always local
389 to __pthread_manager().
390 (manager_mask_all): Removed completely.
391 (__pthread_manager): Remove manager_mask_all initialization.
392 (pthread_handle_create): Remove code to set and reset signal mask
393 around __clone2() calls.
395 2001-02-17 Jakub Jelinek <jakub@redhat.com>
397 * spinlock.c (__pthread_lock): Force lock->__status to be read from
398 memory on every spin.
400 2001-02-10 Andreas Jaeger <aj@suse.de>
402 * Makefile (extra-objs): New.
404 2001-02-09 Jakub Jelinek <jakub@redhat.com>
406 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
407 __pthread_initialize_minimal prototype.
409 2001-02-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
411 * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
413 2001-02-06 Martin Schwidefsky <schwidefsky@de.ibm.com>
415 * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
417 2001-02-06 Ulrich Drepper <drepper@redhat.com>
419 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
420 broken code. Patch by Jes Sorensen.
422 2001-02-06 Andreas Jaeger <aj@suse.de>
424 * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
426 * internals.h: ...here.
428 2001-02-05 Jes Sorensen <jes@linuxcare.com>
430 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
432 2001-02-02 Ulrich Drepper <drepper@redhat.com>
434 * Versions: Remove __pthread_initialize_minimal.
436 2001-02-01 Ulrich Drepper <drepper@redhat.com>
438 * Makefile: Add rules to build crti.o and make it being used in
439 building libpthread.so.
440 * sysdeps/i386/Makefile: New file.
441 * sysdeps/pthread/pt-initfini.c: New file.
443 * pthread.c: Cleanups.
445 2001-01-28 Andreas Jaeger <aj@suse.de>
447 * oldsemaphore.c (__old_sem_init): Adjust for last change.
448 * sysdeps/pthread/bits/libc-lock.h: Likewise.
449 * spinlock.c: Likewise.
451 2001-01-28 Ulrich Drepper <drepper@redhat.com>
453 * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
454 * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
455 * manager.c: Adjust for namespace cleanup in bits/initspin.h.
456 * pthread.c: Likewise.
457 * spinlock.h: Likewise.
458 * sysdeps/pthread/pthread.h: Likewise.
460 2001-01-26 Ulrich Drepper <drepper@redhat.com>
462 * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
463 as struct __pthread_attr_s.
465 * semaphore.h (sem_t): Cleanup namespace, rename status and
468 2001-01-13 Jakub Jelinek <jakub@redhat.com>
470 * pthread.c (pthread_onexit_process): Clear
471 __pthread_manager_thread_bos after freeing it.
472 * Makefile (tests): Add ex16.
473 * Examples/ex16.c: New file.
475 2001-01-11 Jakub Jelinek <jakub@redhat.com>
477 * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
479 * pthread.c (pthread_exit_process): Rename to...
480 (pthread_onexit_process): ...this.
481 (pthread_atexit_process, pthread_atexit_retcode): New.
482 (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
483 and only if HAVE_Z_NODELETE is not defined.
484 (__pthread_initialize_manager): Register pthread_atexit_retcode
487 2001-01-11 Ulrich Drepper <drepper@redhat.com>
489 * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
491 2001-01-11 Jakub Jelinek <jakub@redhat.com>
493 * Makefile (tests): Add ex15.
494 * Examples/ex15.c: New test.
496 2001-01-08 Ulrich Drepper <drepper@redhat.com>
498 * pthread.c (pthread_exit_process): Free memory allocated for
501 2000-12-31 Ulrich Drepper <drepper@redhat.com>
503 * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
504 (pthread_free): Always unmap the stack. It's safe now that we don't
505 use MAP_FIXED to allocate stacks.
507 2000-12-31 Ulrich Drepper <drepper@redhat.com>
509 * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
511 * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
513 2000-11-15 Wolfram Gloger <wg@malloc.de>
515 * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
516 stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
518 2000-12-27 Andreas Jaeger <aj@suse.de>
520 * Examples/ex13.c: Make local functions static.
521 * ecmutex.c: Likewise.
522 * joinrace.c: Likewise.
523 * Examples/ex14.c: Likewise.
525 * Examples/ex2.c: Make local functions static; reformat.
526 * Examples/ex1.c: Likewise.
527 * Examples/ex4.c: Likewise.
528 * Examples/ex5.c: Likewise.
529 * Examples/ex7.c: Likewise.
531 * oldsemaphore.c: Add prototypes to shut up GCC.
532 * pt-machine.c: Likewise.
534 * weaks.c: Add prototype for pthread_exit.
536 * internals.h: Add some prototypes, format prototypes and add
538 Move __libc_waitpid prototype to include/sys/wait.h.
540 * rwlock.c: Include <bits/libc-lock.h> for prototypes.
542 * specific.c: Likewise.
543 * ptfork.c: Likewise.
545 * lockfile.c: Include internals.h to get prototypes.
546 * events.c: Likewise.
547 * sysdeps/alpha/pspinlock.c: Likewise.
548 * sysdeps/arm/pspinlock.c: Likewise.
549 * sysdeps/hppa/pspinlock.c: Likewise.
550 * sysdeps/i386/pspinlock.c: Likewise.
551 * sysdeps/ia64/pspinlock.c: Likewise.
552 * sysdeps/m68k/pspinlock.c: Likewise.
553 * sysdeps/mips/pspinlock.c: Likewise.
554 * sysdeps/powerpc/pspinlock.c: Likewise.
555 * sysdeps/s390/pspinlock.c: Likewise.
556 * sysdeps/sh/pspinlock.c: Likewise.
557 * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
558 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
559 * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
561 2000-12-27 Ulrich Drepper <drepper@redhat.com>
563 * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
564 (__pthread_attr_getstack): Return correct address.
565 Add warnings for using pthread_attr_getstackaddr and
566 pthread_attr_setstackaddr.
568 2000-12-26 Ulrich Drepper <drepper@redhat.com>
570 * Examples/ex6.c (test_thread): Make static.
571 * Examples/ex12.c (test_thread): Make static and add noreturn
574 2000-12-18 Jes Sorensen <jes@linuxcare.com>
576 * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
577 and compare_and_swap_with_release_semantics returns int not long.
579 2000-12-17 Andreas Jaeger <aj@suse.de>
581 * sysdeps/s390/pt-machine.h (testandset): Use long int as return
583 * sysdeps/arm/pt-machine.h (testandset): Likewise.
584 * sysdeps/hppa/pt-machine.h (testandset): Likewise.
585 * sysdeps/m68k/pt-machine.h (testandset): Likewise.
586 * sysdeps/sh/pt-machine.h (testandset): Likewise.
587 * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
588 * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
590 2000-12-17 Ulrich Drepper <drepper@redhat.com>
592 * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
593 * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
595 2000-12-17 Andreas Jaeger <aj@suse.de>
597 * internals.h: Add prototypes for testandset and
598 __compare_and_swap to shut up gcc warnings.
600 2000-12-06 Wolfram Gloger <wg@malloc.de>
602 * join.c (pthread_detach): Allow case where the thread has already
605 2000-12-05 Andreas Jaeger <aj@suse.de>
607 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
608 * sysdeps/mips/pt-machine.h (testandset): Likewise.
609 (__compare_and_swap): Likewise.
610 Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
612 2000-11-20 Jakub Jelinek <jakub@redhat.com>
614 * Examples/ex3.c (main): Cast int to long before casting to void *.
615 (search): Cast void * to long, not int.
616 * Examples/ex8.c (main, thread): Similarly.
617 * Examples/ex11.c (main): Similarly.
618 * Examples/ex14.c (worker, do_test): Similarly.
619 * ecmutex.c (worker, do_test): Similarly.
620 (nlocks): Cast to int.
622 2000-11-08 Bruce Mitchener <bruce@cubik.org>
624 * linuxthreads.texi: Add documentation for pthreads attributes
625 guardsize, stackaddr, stacksize, and stack. Fix typo in previous
626 patch. Document pthread_[sg]etconcurrency(). Mark
627 pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
629 2000-11-07 Ulrich Drepper <drepper@redhat.com>
631 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
633 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
634 Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
636 2000-11-06 Ulrich Drepper <drepper@redhat.com>
638 * cancel.c (pthread_cancel): Always set p_canceled, even if we are
639 not doing it right now.
640 Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
642 2000-10-30 Ulrich Drepper <drepper@redhat.com>
644 * Examples/ex4.c (main): Don't use exit() to avoid warning with
647 2000-10-29 Ulrich Drepper <drepper@redhat.com>
649 * attr.c (__pthread_attr_setguardsize): Don't round guardsize
650 here. Reported by Bruce Mitchener <bruce@cubik.org>.
652 * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
653 discussing mutexes. (As per the Unix98 name for the API.)
654 Changes documentation for pthread_mutexattr_setkind_np() and
655 pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
656 same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
657 Changes references to PTHREAD_MUTEXATTR_FAST_NP to
658 PTHREAD_MUTEXATTR_ADAPTIVE_NP.
659 Begins to introduce discussion of the ``timed'' mutex type. This
660 discussion is currently incomplete.
661 Patch by Bruce Mitchener <bruce@cubik.org>.
663 2000-10-26 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
664 Yutaka Niibe <gniibe@chroot.org>
666 * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
667 has restrictions, use register.
669 2000-10-23 Andreas Schwab <schwab@suse.de>
671 * Examples/ex14.c (TIMEOUT): Override default timeout.
673 2000-10-16 Ulrich Drepper <drepper@redhat.com>
675 * specific.c: Protect tsd array modification in thread data
676 structures by getting the thread lock in pthread_key_delete and
677 __pthread_destroy_specifics.
678 Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
680 2000-10-12 Alan Modra <alan@linuxcare.com.au>
682 * sysdeps/pthread/bits/initspin.h: New file.
683 * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
684 (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
685 (__pthread_alt_init_lock): Likewise.
686 (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
688 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
690 * oldsemaphore.c (__old_sem_init): Release lock with
691 LT_SPINLOCK_INIT, not zero.
692 * spinlock.c (__pthread_unlock): Likewise.
693 (__pthread_alt_lock): Likewise.
694 (__pthread_alt_timedlock): Likewise.
695 (__pthread_alt_unlock): Likewise.
696 * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
697 LT_SPINLOCK_INIT if it is non-zero. Likewise for init-once flags.
698 * sysdeps/pthread/pthread.h: Include bits/initspin.h. Use
699 LT_SPINLOCK_INIT do initialize spinlocks not 0.
701 2000-10-12 David Huggins-Daines <dhd@linuxcare.com>
703 * shlib-versions: Add version definitions for hppa-linux.
705 2000-10-12 Alan Modra <alan@linuxcare.com.au>
707 * sysdeps/hppa/pspinlock.c: New file.
708 * sysdeps/hppa/pt-machine.h: New file.
709 * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
711 2000-10-05 Jakub Jelinek <jakub@redhat.com>
713 * mutex.c (__pthread_mutex_destroy): Correct test of
714 busy mutex for mutexes using alternate fastlocks.
715 Patch by dtc@cmucl.cons.org.
717 2000-09-28 Martin Schwidefsksy <schwidefsky@de.ibm.com>
719 * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
721 2000-09-28 Ulrich Drepper <drepper@redhat.com>
723 * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
724 test for owner first.
725 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
727 * cancel.c (pthread_cancel): Don't do anything if cancelation is
730 2000-09-26 Ulrich Drepper <drepper@redhat.com>
732 * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
733 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
735 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
736 _POSIX_MONOTONIC_CLOCK.
738 * spinlock.h (__pthread_set_own_extricate_if): Add back locking
741 2000-09-20 Andreas Jaeger <aj@suse.de>
743 * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
744 "testrtsig.h" conditional.
746 2000-09-11 Ulrich Drepper <drepper@redhat.com>
748 * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
749 pthread_attr_setstack.
750 * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
751 pthread_attr_setstack.
752 * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
754 2000-09-05 Ulrich Drepper <drepper@redhat.com>
756 * Examples/ex14.c: New file.
757 * Makefile (tests): Add ex14.
759 * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
760 mutex. Patch by dtc@cmucl.cons.org.
762 * ecmutex.c: New file.
763 * Makefile (tests): Add ecmutex.
765 2000-09-04 H.J. Lu <hjl@gnu.org>
767 * attr.c (__pthread_attr_setguardsize): Use page_roundup
768 instead of roundup to round up to the page size.
770 2000-09-03 Mark Kettenis <kettenis@gnu.org>
772 * manager.c (pthread_exited): Correctly report event as TD_REAP
773 instead of TD_DEATH. Fix comments.
775 2000-09-03 Ulrich Drepper <drepper@redhat.com>
777 * spinlock.h (testandset): Add cast to avoid warning.
778 Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
780 2000-09-02 Andreas Jaeger <aj@suse.de>
782 * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
785 2000-09-01 Ulrich Drepper <drepper@redhat.com>
787 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
788 Fix typo in last patch (_mode -> _flags).
790 * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
791 Provide definition which respects _IO_USER_LOCK flag.
793 2000-08-30 Ulrich Drepper <drepper@redhat.com>
795 * manager.c (pthread_allocate_stack): Clear descriptor only if not
798 2000-08-25 Ulrich Drepper <drepper@redhat.com>
800 * Makefile: Add rules to build and run unload.
801 * unload.c: New file.
803 * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
805 * sysdeps/pthread/pthread.h
806 (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
807 (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
809 2000-08-24 Andreas Jaeger <aj@suse.de>
811 * Examples/ex13.c: Include <string.h> for strerror prototype and
812 <stdlib.h> for abort prototype.
813 (pthr_cond_signal_mutex): Rewrite to silence GCC.
814 (thread_start): Remove unused variable err.
815 (main): Silence GCC warnings.
817 2000-08-22 Andreas Jaeger <aj@suse.de>
819 * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
821 * Makefile (tests): Add ex13.
823 2000-08-20 Ulrich Drepper <drepper@redhat.com>
825 * semaphore.h: Add restrict where required by AGd4.
826 * sysdeps/pthread/pthread.h: Likewise.
827 * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
829 2000-08-15 Ulrich Drepper <drepper@redhat.com>
831 * Makefile (tests): Add ex12. Add rule to build it.
832 * Examples/ex12.c: New file.
834 2000-08-13 Ulrich Drepper <drepper@redhat.com>
836 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
837 even though the implementation is not quite complete (but it reports
838 it). Define _POSIX_MESSAGE_PASSING to -1.
839 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
841 2000-08-12 Andreas Jaeger <aj@suse.de>
843 * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
845 (__compare_and_swap): Likewise.
846 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
848 2000-08-10 Ulrich Drepper <drepper@redhat.com>
850 * pthread.c (__pthread_initial_thread): Initialize p_errnop and
851 p_h_errnop correctly and not to NULL.
853 2000-08-05 Ulrich Drepper <drepper@redhat.com>
855 * Banner: Bump version number to 0.9.
857 2000-08-04 Ulrich Drepper <drepper@redhat.com>
859 * Makefile (tests): Add tststack. Add rule to build the program.
860 * tststack.c: New file.
862 * internals.h: Declare __pthread_max_stacksize.
863 * pthread.c (__pthread_max_stacksize): New variable.
864 (__pthread_initialize_manager): Determine __pthread_initialize_manager
866 * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
867 (pthread_allocate_stack): Allow kernel to choose stack address if
868 FLOATING_STACKS. This also handles variable-sized stacks.
869 Always allocate stack and guardpage together. Use mprotect to
870 change guardpage access.
871 * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
874 * attr.c (__pthread_attr_setstacksize): Also test value against
877 * manager.c (__pthread_nonstandard_stacks): Define only if
878 THREAD_SELF is not defined.
879 (pthread_allocate_stack): Always initialize gardaddr to a correct
881 (pthread_handle_create): Unmap thread with one call.
882 (pthread_free): Remove test for initial thread before removing stack.
883 Unmap stack with one call.
885 * pthread.c (__pthread_initial_thread): Initialize p_userstack to
886 1 to avoid removing the stack.
888 2000-07-27 Jes Sorensen <jes@linuxcare.com>
890 * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
891 load of spin lock to prime the cache before the atomic compare and
892 exchange operation (cmpxchg4). This avoids the spinning on the
893 cmpxchg4 instruction and reduces movement of the cache line back
894 and forth between the processors (explanation by Asis K. Mallick
895 from Intel). This basically makes the implementation operate the
896 same as the Linux kernel implementation.
898 * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
899 * sysdeps/ia64/pspinlock.c: New file.
901 2000-08-03 Ulrich Drepper <drepper@redhat.com>
903 * pthread.c: Move definition of __pthread_set_own_extricate_if...
904 * spinlock.h: ...here. Remove locking.
905 * internals.h: Remove __pthread_set_own_extricate_if prototype.
907 * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
908 (rwlock_rd_extricate_func): Don't determine self, let
909 __pthread_lock do it.
910 (rwlock_wr_extricate_func): Likewise.
911 (rwlock_have_already): Optimize *pself handling a bit.
913 * mutex.c: Use __builtin_expect.
914 * pthread.c: Likewise.
916 2000-08-02 Andreas Jaeger <aj@suse.de>
918 * sysdeps/s390/pspinlock.c: New file.
919 * sysdeps/s390/pt-machine.h: New file.
920 Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
922 2000-07-12 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
924 * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
926 * sysdeps/mips/pt-machine.h (testandset): Likewise.
928 2000-07-26 Andreas Jaeger <aj@suse.de>
930 * pthread.c: Initialize p_sem_avail.
932 2000-07-25 Ulrich Drepper <drepper@redhat.com>
934 * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
935 * semaphore.c: Handle spurious wakeups.
937 * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
938 for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
940 * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
941 (__pthread_wait_for_restart): Likewise.
943 * condvar.c (pthread_cond_wait): Also check whether thread is
944 cancelable before aborting loop.
945 (pthread_cond_timedwait): Likewise.
947 * signals.c (pthread_sighandler): Remove special code to restrore
949 (pthread_sighandler_t): Likewise.
951 2000-07-25 Mark Kettenis <kettenis@gnu.org>
953 * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
954 * pthread.c: Include <resolv.h>.
955 (_res): Undefine. Add extern declaration.
957 2000-07-24 Ulrich Drepper <drepper@redhat.com>
959 * pthread.c (__pthread_initial_thread): Update initializer.
960 (__pthread_manager_thread): Likewise.
961 (pthread_initialize): Move setrlimit call to...
962 (__pthread_initialize_manager): ...here.
963 (__pthread_reset_main_thread): Reset also soft limit on stack size.
965 * condvar.c: Handle spurious wakeups. [PR libc/1749].
966 * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
968 2000-07-21 Ulrich Drepper <drepper@redhat.com>
970 * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
971 __compare_and_swap to define testandset.
972 * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
973 Define IMPLEMENT_TAS_WITH_CAS.
975 2000-07-20 Ulrich Drepper <drepper@redhat.com>
977 * Makefile: Pass -z nodelete to linker for libpthread.so
978 generation if it understand this option.
980 2000-07-18 Mark Kettenis <kettenis@gnu.org>
982 * manager.c (pthread_handle_create): Remove initialization of
983 new_thread->p_res._sock.
985 2000-07-19 Kaz Kylheku <kaz@ashi.footprints.net>
987 Bugfixes to the variant of the code for machines with no compare
990 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
991 node was not being properly enqueued, due to failing to update
992 the lock->__status field.
994 * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
995 being set inappropriately, causing the suspend function to be called
996 with a null self pointer and crash.
998 2000-07-18 Ulrich Drepper <drepper@redhat.com>
1000 * spinlock.h (__pthread_alt_trylock): Fix code used if no
1001 compare&swap is available.
1003 * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
1006 * pthread.c (pthread_initialize): Don't use sysconf to determine
1007 whether the machine has more than one processor.
1009 * spinlock.c (__pthread_alt_timedlock): Add back one of the
1010 removed thread_self calls.
1012 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
1014 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
1015 __compare_and_swap to compare_and_swap in code which assumes
1016 compare swap is available.
1018 2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
1020 * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
1021 bug whereby thr field of waitnode structure would not be correctly
1022 set unless a null self pointer is passed to the functions.
1023 Eliminated redundant calls to thread_self().
1025 2000-07-18 Jakub Jelinek <jakub@redhat.com>
1027 * pthread.c (__pthread_initialize_manager): Lock
1028 __pthread_manager_thread.p_lock before calling clone.
1030 2000-05-05 H.J. Lu <hjl@gnu.org>
1032 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
1033 have acquire semantics.
1034 (__compare_and_swap_with_release_semantics): New inline
1036 (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
1038 2000-01-28 Hans Boehm <hboehm@exch.hpl.hp.com>
1040 * manager.c: Fix the problem with signals at startup.
1041 Change the way that thread stacks are allocated on IA64.
1042 Clean up some of the guard page allocation stuff.
1044 1999-12-19 H.J. Lu <hjl@gnu.org>
1046 * internals.h (page_roundup): New.
1047 * attr.c (__pthread_attr_setguardsize); Use page_roundup
1049 * manager.c (pthread_allocate_stack): Make sure guardaddr is
1050 page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
1053 1999-12-17 Hans Boehm <hboehm@exch.hpl.hp.com>
1055 * manager.c (pthread_allocate_stack): Unmap the stack top
1056 if failed to map the stack bottom.
1058 (pthread_free): Fix the guard page.
1060 * pthread.c (pthread_initialize): Set rlimit correctly for
1061 NEED_SEPARATE_REGISTER_STACK.
1063 1999-12-16 H.J. Lu <hjl@gnu.org>
1065 * pthread.c (__pthread_initialize_manager): Pass
1066 __pthread_manager_thread_bos instead of
1067 __pthread_manager_thread_tos to __clone2.
1069 1999-12-16 H.J. Lu <hjl@gnu.org>
1071 * manager.c (pthread_allocate_stack): Correct the calculation
1072 of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
1075 1999-12-13 H.J. Lu <hjl@gnu.org>
1077 * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
1078 bit after setting ar.ccv.
1080 1999-12-12 H.J. Lu <hjl@gnu.org>
1082 * manager.c (pthread_allocate_stack): Make the starting
1083 address of the stack bottom page aligned. FIXME: it may
1084 need changes in other places.
1085 (pthread_handle_create): Likewise.
1087 1999-12-11 Hans Boehm <hboehm@exch.hpl.hp.com>
1089 * manager.c (pthread_allocate_stack): Handle
1090 NEED_SEPARATE_REGISTER_STACK.
1091 (pthread_handle_create): Likewise.
1092 * pthread.c (__pthread_initialize_manager): Likewise.
1094 * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
1096 1999-12-02 H.J. Lu <hjl@gnu.org>
1098 * sysdeps/ia64/pt-machine.h: New.
1100 2000-07-13 Ulrich Drepper <drepper@redhat.com>
1102 * wrapsyscall.c: Mark non-__ protected names as weak.
1105 2000-07-12 Bruno Haible <haible@clisp.cons.org>
1107 * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
1109 2000-07-12 Ulrich Drepper <drepper@redhat.com>
1111 * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
1112 Add tests also to new alternative spinlock implementation.
1113 * spinlock.h: Likewise.
1114 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1116 2000-07-06 Ulrich Drepper <drepper@redhat.com>
1118 * Version: Export __sigaction.
1119 * signals.c: Define __sigaction alias. Use __libc_sigaction instead
1121 * pthread.c: Use __libc_sigaction instead of __sigaction.
1123 * condvar.c: Implement pthread_condattr_getpshared and
1124 pthread_condattr_setpshared.
1125 * mutex.c: Implement pthread_mutexattr_getpshared and
1126 pthread_mutexattr_setpshared.
1127 * Versions: Export new functions.
1128 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1130 * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
1131 (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
1134 2000-07-04 Greg McGary <greg@mcgary.org>
1136 * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
1137 pragmas. Include bp-sym.h only if _LIBC.
1139 2000-07-04 Ulrich Drepper <drepper@redhat.com>
1141 * spinlock.c (__pthread_unlock): Properly place write barrier.
1142 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1144 2000-07-03 Ulrich Drepper <drepper@redhat.com>
1146 * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
1147 faster on SMP systems. No more emulation of compare&swap for adaptive
1149 * spinlock.h: Likewise.
1150 * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
1151 Replace fast with adaptive mutex.
1152 * mutex.c: Rewrite for replacement of fast by adaptive mutex.
1153 * condvar.c: Likewise.
1154 * pthread.c: Define and initialize __pthread_smp_kernel variable.
1155 * internals.h: Declare __pthread_smp_kernel.
1156 * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
1157 _pthread_fastlock structure.
1158 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1160 * pthread.c: Remove initialization to zero from global variables.
1162 2000-06-29 Jakub Jelinek <jakub@redhat.com>
1164 * shlib-versions: Make sparc64 GLIBC_2.2+ only.
1166 2000-06-28 Greg McGary <greg@mcgary.org>
1168 * weaks.c: Wrap BP_SYM () around weak extern declarations of
1169 pthread functions that have pointers in their return+arg signatures.
1171 2000-06-27 Greg McGary <greg@mcgary.org>
1173 * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
1174 extern declarations of pthread functions that have pointers in
1175 their return+arg signatures.
1177 2000-06-26 Ulrich Drepper <drepper@redhat.com>
1179 * Makefile (tests): Add ex11. Add rules to build it.
1180 * Examples/ex11.c: New file.
1181 * rwlock.c: Fix complete braindamaged previous try to implement
1184 * spinlock.c: Pretty print.
1186 2000-06-25 Ulrich Drepper <drepper@redhat.com>
1188 * Makefile (tests): Add ex10. Add rules to build it.
1189 * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
1190 pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
1191 * condvar.c (pthread_cond_wait): Allow mutex of kind
1192 PTHREAD_MUTEX_TIMED_NP.
1193 (pthread_cond_timedwait_relative): Likewise.
1194 * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
1195 (__pthread_mutex_trylock): Use __pthread_alt_trylock for
1196 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1197 (__pthread_mutex_lock): Use __pthread_alt_lock for
1198 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1199 (__pthread_mutex_timedlock): New function.
1200 (__pthread_mutex_unlock): Use __pthread_alt_unlock for
1201 PTHREAD_MUTEX_ERRORCHECK_NP. Handle PTHREAD_MUTEX_TIMED_NP.
1202 (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
1203 (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
1204 * spinlock.c: Implement alternate fastlocks.
1205 * spinlock.h: Add prototypes.
1206 * Examples/ex10.c: New file.
1207 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
1208 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1210 * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
1211 (__pthread_rwlock_timedrdlock): New function.
1212 (__pthread_rwlock_timedwrlock): New function.
1213 Use laternate fastlock function everywhere.
1215 2000-06-21 Andreas Jaeger <aj@suse.de>
1217 * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
1220 * join.c: Include <stdlib.h> for exit prototype.
1222 2000-06-20 Ulrich Drepper <drepper@redhat.com>
1224 * sysdeps/i386/useldt.h: Include <stdlib.h>.
1226 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
1227 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1229 * Makefile (libpthread-routines): Add barrier.
1230 (tests): Add ex9. Add rule to build ex9.
1231 * Versions: Export barrier functions.
1232 * barrier.c: New file.
1233 * Examples/ex9.c: New file.
1234 * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
1235 * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
1236 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1238 2000-06-19 H.J. Lu <hjl@gnu.org>
1240 * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
1241 HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
1242 (compare_and_swap_with_release_semantics): New. Default to
1243 compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
1246 * spinlock.c (__pthread_unlock): Call
1247 compare_and_swap_with_release_semantics () instead of
1248 compare_and_swap ().
1250 2000-06-19 Ulrich Drepper <drepper@redhat.com>
1252 * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
1254 * sysdeps/pthread/timer_delete.c: Likewise.
1255 * sysdeps/pthread/timer_getoverr.c: Likewise.
1256 * sysdeps/pthread/timer_gettime.c: Likewise.
1257 * sysdeps/pthread/timer_settime.c: Likewise.
1259 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
1261 Timer nodes are now reference counted, and can be marked
1262 as deleted. This allows for the safe release of the global mutex
1263 in the middle without losing the timer being operated on.
1265 * sysdeps/pthread/posix-timer.h (struct timer_node): The inuse
1266 member is now an enum with three values, so that an intermediate
1267 state can be represented (deleted but not free for reuse yet).
1268 New refcount member added.
1269 * sysdeps/pthread/timer_routines.c: Likewise.
1271 * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
1272 timer_valid): New inline functions added.
1274 * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
1275 restructured, recursive deadlock bug fixed.
1277 * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
1278 timer_addref to ensure that timer won't be deleted while mutex is not
1279 held. Also uses timer_invalid to perform validation of timer handle.
1280 * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
1281 * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
1283 2000-06-14 Ulrich Drepper <drepper@redhat.com>
1285 * shlib-versions: Add entry for SH.
1286 Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
1288 2000-06-13 Kaz Kylheku <kaz@ashi.footprints.net>
1290 A few optimizations. Got rid of unnecessary wakeups of timer threads,
1291 tightened up some critical regions and micro-optimized some list
1294 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1295 Returns int value now to indicate whether timer was queued at head.
1296 * sysdeps/pthread/posix-timer.h: Likewise.
1297 * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
1298 new return value from __timer_thread_queue_timer to avoid waking
1299 up timer thread unnecessarily.
1301 * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
1302 inuse flag, because this requires mutex to be held. Callers updated
1303 to do the check when they have the mutex.
1304 * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
1306 * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
1307 regions: avoids making system calls while holding timer mutex, and
1308 a few computations were moved outside of the mutex as well.
1309 * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
1311 * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
1312 to list_unlink_ip, meaning idempotent. Pointer manipulation
1313 changed to get better better code out of gcc.
1314 * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
1315 version of list_unlink added here.
1316 * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
1317 function in all places: idempotent one for timers, non-idempotent
1318 one for thread nodes.
1319 * sysdeps/pthread/timer_settime: Likewise.
1320 * sysdeps/pthread/timer_routines.c: Likewise.
1322 2000-06-13 Ulrich Drepper <drepper@redhat.com>
1324 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
1325 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1327 * sysdeps/pthread/Makefile: Remove tests definition.
1329 2000-06-12 Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
1330 Yutaka Niibe <gniibe@chroot.org>
1332 * sysdeps/sh/pspinlock.c: New file.
1333 * sysdeps/sh/pt-machine.h: New file.
1335 2000-06-12 Ulrich Drepper <drepper@redhat.com>
1337 * Makefile (tests): Add joinrace.
1339 * Examples/ex6.c: Test return value of pthread_join.
1341 2000-06-11 Geoff Keating <geoffk@cygnus.com>
1343 * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
1344 (__pthread_spin_trylock): Implement.
1345 (__pthread_spin_unlock): Implement.
1346 (__pthread_spin_init): Implement.
1347 (__pthread_spin_destroy): Implement.
1349 2000-06-10 Ulrich Drepper <drepper@redhat.com>
1351 * sysdeps/pthread/timer_routines.c (list_append): Little fix to
1352 really append the entry.
1354 2000-06-10 Andreas Jaeger <aj@suse.de>
1356 * lockfile.c (__fresetlockfiles): Remove unused variable fp.
1358 2000-06-10 Kaz Kylheku <kaz@ashi.footprints.net>
1360 * sysdeps/pthread/timer_create.c: Thread matching now done on
1361 clock type as well as thread attributes.
1362 There are individual global signal-delivering threads for
1363 different clock types.
1364 * sysdeps/pthread/posix-timer.h: Likewise.
1365 * sysdeps/pthread/timer_routines.c: Likewise.
1367 * sysdeps/pthread/timer_routines.c: Thread allocation and
1368 deallocation function now remembers to put thread on active
1369 list and remove from active list.
1370 Thus now the feature of binding multiple timers
1371 to a single thread actually works.
1373 2000-06-10 Ulrich Drepper <drepper@redhat.com>
1375 * pthread.c (__pthread_create_2_1): Optimize a bit.
1377 * internals.h (invalid_handle): Also test for p_terminated != 0.
1378 (nonexisting_handle): New function. Same as old invalid_handle.
1379 * join.c (pthread_join): Use nonexisting_handle instead of
1380 invalid_handle to test for acceptable thread handle.
1381 * manager.c (pthread_handle_free): Likewise.
1382 * joinrace.c: New file.
1383 Reported by Permaine Cheung <pcheung@cygnus.com>.
1385 2000-06-08 Ulrich Drepper <drepper@redhat.com>
1387 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1388 Correct handling of matching variable.
1390 * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
1393 * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1394 Be prepared for empty timer list.
1396 * sysdeps/pthread/timer_create.c (timer_create): Correct names of
1397 CPUTIME clock ID. Add support for thread clocks.
1399 * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
1400 subtraction were switched.
1402 * sysdeps/pthread/timer_routines.c (init_module): Use
1403 THREAD_MAXNODES threads.
1405 * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
1406 * sysdeps/pthread/timer_create.c: Fill in creator_pid.
1407 * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
1408 with sigqueueinfo is this system call is available.
1410 * sysdeps/pthread/timer_create.c (timer_create): Allow
1411 CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
1413 * sysdeps/pthread/Makefile: New file. Add rules to build timer
1415 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
1417 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
1419 * sysdeps/pthread/posix-timer.h: New file.
1420 * sysdeps/pthread/timer_create.c: New file.
1421 * sysdeps/pthread/timer_delete.c: New file.
1422 * sysdeps/pthread/timer_getoverr.c: New file.
1423 * sysdeps/pthread/timer_gettime.c: New file.
1424 * sysdeps/pthread/timer_routines.c: New file.
1425 * sysdeps/pthread/timer_settime.c: New file.
1426 * sysdeps/pthread/tst-timer.c: New file.
1428 2000-06-08 Ulrich Drepper <drepper@redhat.com>
1430 * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
1431 LINK_MAX definitions if necessary.
1433 2000-06-04 Kaz Kylheku <kaz@ashi.footprints.net>
1435 Added missing fork time handling of global libio lock.
1437 * lockfile.c (__fresetlockfiles): Now also resets the list lock,
1438 not just the individual stream locks. Rewritten to use new
1439 iterator interface provided by libio rather than accessing
1442 * lockfile.c (__flockfilelist, _funlockfilelist): New functions
1443 which lock and unlock the stream list using the new interface
1445 * internals.h: Likewise.
1447 * ptfork.c (__fork): Now calls __flockfilelist before fork,
1448 and __funlockfilelist in the parent after the fork.
1449 Child still calls __fresetlockfiles as before.
1451 * linuxthreads.texi: Now explains what happens to streams at
1452 fork time. Also whole new section on forking and thread added.
1453 Definition of pthread_atfork moved out of Miscellaneous Functions
1454 to this new section.
1456 2000-06-04 Jakub Jelinek <jakub@redhat.com>
1458 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
1459 Add missing register.
1460 * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
1462 2000-06-02 Jakub Jelinek <jakub@redhat.com>
1464 * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
1465 * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
1466 * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
1468 2000-05-31 Andreas Jaeger <aj@suse.de>
1470 * sysdeps/mips/pspinlock.c: Implement spinlocks.
1472 2000-05-28 Ulrich Drepper <drepper@redhat.com>
1474 * spinlock.c (__pthread_lock): Remove ASSERT.
1476 * Makefile (tests): Add ex8.
1477 * Examples/ex8.c: New file.
1479 2000-05-12 Kaz Kylheku <kaz@ashi.footprints.net>
1481 Bugfix: The pthread_atfork mechanism now takes care of its
1482 own internal mutex at fork time.
1484 * ptfork.c (__fork): Revised so that the mutex is held across
1485 the fork operation and while the handlers are called, and so that
1486 the child resets the mutex.
1488 * linuxthreads.texi: Updated pthread_atfork documentation to make
1489 it clear that fork and pthread_atfork can't be reentered from
1490 atfork handlers, that pthread_atfork and fork are mutually atomic,
1491 and that the handlers are inherited by the child process.
1493 2000-05-24 Ulrich Drepper <drepper@redhat.com>
1495 * Makefile (libpthread-routines): Add pspinlock.
1496 * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
1497 Use struct _pthread_fastlock instead of pthread_spinlock_t.
1498 * condvar.c: Likewise.
1499 * internals.h: Likewise.
1501 * manager.c: Likewise.
1502 * mutex.c: Likewise.
1503 * pthread.c: Likewise.
1504 * rwlock.c: Likewise.
1505 * semaphore.c: Likewise.
1506 * signals.c: Likewise.
1507 * spinlock.h: Likewise.
1508 * spinlock.c: Likewise. Remove pthread_spin_lock functions.
1509 * sysdeps/alpha/pspinlock.c: New file.
1510 * sysdeps/arm/pspinlock.c: New file.
1511 * sysdeps/i386/pspinlock.c: New file.
1512 * sysdeps/m68k/pspinlock.c: New file.
1513 * sysdeps/mips/pspinlock.c: New file.
1514 * sysdeps/powerpc/pspinlock.c: New file.
1515 * sysdeps/sparc/sparc32/pspinlock.c: New file.
1516 * sysdeps/sparc/sparc64/pspinlock.c: New file.
1517 * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
1518 back to _pthread_fastlock. Define new pthread_spinlock_t.
1520 2000-05-24 Andreas Jaeger <aj@suse.de>
1522 * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
1524 2000-05-21 Jakub Jelinek <jakub@redhat.com>
1526 * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
1528 2000-05-13 Jakub Jelinek <jakub@redhat.com>
1530 * internals.h (__RES_PTHREAD_INTERNAL): Define.
1532 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
1534 * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
1535 object state is represented with additional bits which distinguish
1536 whether that state was set up in the current process, or
1537 in an ancestor process. If that state was set in an ancestor,
1538 it means that a fork happened while thread was executing the init
1539 function. In that case, the state is reset to NEVER.
1540 * mutex.c (__pthread_once_fork_prepare): New function.
1541 (__pthread_once_fork_child): Likewise
1542 (__pthread_once_fork_parent): Likewise
1543 (__pthread_reset_pthread_once): Removed.
1544 * ptfork.c (__fork): Call new handlers in mutex.c.
1545 * internals.h: Declarations of new mutex.c functions added.
1546 Declaration of removed function deleted.
1547 * linuxthreads.texi: Updated documentation about pthread_once
1548 to clarify what happens under cancellation and forking.
1550 2000-05-06 Kaz Kylheku <kaz@ashi.footprints.net>
1552 * internals.h: New thread manager request type, REQ_KICK.
1553 * join.c (pthread_exit): main thread now calls exit() instead
1554 of _exit() in order to proper process cleanup.
1555 * manager.c (__pthread_manager): Do not terminate manager
1556 after unblocking main thread; wait for main thread's
1557 REQ_PROCESS_EXIT request instead.
1558 Also, added REQ_KICK case to handle new request; this just does
1560 * manager.c (pthread_exited): Do not terminate manager after
1561 unblocking main thread.
1562 * manager.c (__pthread_manager_sighandler): If the main thread
1563 is waiting for all other threads to die, send a REQ_KICK into
1564 the thread manager request pipe to get it to clean out the threads
1565 and unblock the main thread as soon as possible. This fixes
1566 the 2000 millisecond hang on shutdown bug.
1567 * Examples/ex7.c: New file, tests shutdown behavior when all threads
1568 including the main one call pthread_exit(), or implicitly do so.
1569 * Makefile (tests): Add ex7.
1571 2000-05-05 Andreas Jaeger <aj@suse.de>
1573 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1574 (pthread_getcpuclockid): Correct test for ourselves.
1576 2000-05-05 Ulrich Drepper <drepper@redhat.com>
1578 * internals.h (struct _pthread_descr_struct): Reorganization.
1579 Allocate room for 16 pointers at head of the structure for future
1580 thread-local data handling. Move p_self member in this area.
1581 * manager.c (pthread_handle_create): Adjust use of p_self.
1582 * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
1583 * pthread.c (__pthread_initial_thread): Adjust initialization.
1584 (__pthread_manager_thread): Likewise.
1586 2000-04-29 Bruno Haible <haible@clisp.cons.org>
1588 * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
1589 for eventmask larger than 1 word.
1591 2000-04-27 Ulrich Drepper <drepper@redhat.com>
1593 * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
1594 * pthread.c (__pthread_initialize_minimal): New function. Perform
1595 minimal initialization.
1596 (pthread_initialize): Remove this code here.
1597 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again. We
1598 are working around the problem in glibc.
1600 2000-04-25 Ulrich Drepper <drepper@redhat.com>
1602 * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
1603 now. First gcc must be fixed (more concrete: libgcc).
1605 2000-04-24 Ulrich Drepper <drepper@redhat.com>
1607 * pthread.c: Remove special treatement for interrupt handlers on x86.
1608 * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
1609 * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
1611 * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
1613 2000-04-24 Mark Kettenis <kettenis@gnu.org>
1615 * join.c (pthread_exit): Set p_terminated after reporting the
1616 termination event instead of before.
1618 2000-04-20 Jakub Jelinek <jakub@redhat.com>
1620 * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
1623 2000-04-18 Andreas Jaeger <aj@suse.de>
1625 * Versions: Use ld instead of ld.so.
1627 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1629 * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
1630 Remove the typedef keyword.
1632 2000-04-18 Jakub Jelinek <jakub@redhat.com>
1634 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
1636 (READ_MEMORY_BARRIER): Define.
1637 * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
1639 * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
1642 2000-04-17 Ulrich Drepper <drepper@redhat.com>
1644 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1645 (pthread_getcpuclockid): Don't compare thread_id with thread_self,
1646 use thread_handle().
1648 2000-04-16 Ulrich Drepper <drepper@redhat.com>
1650 * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
1651 if fast mutex is used. Don't initialize `already_canceled' twice.
1652 Correctly test for return value of timedsuspend.
1654 * pthread.c: Correct long-time braino. We never set SA_SIGINFO and
1655 therefore don't need the _rt versions of the signal handlers.
1657 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1659 * pthread.c (pthread_yield): New function.
1660 * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
1661 * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
1662 * internals.h: Declare __pthread_yield.
1664 * pthread.c (pthread_initialize): Avoid a bit more code if
1665 realtime signals are known to exist.
1667 * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
1668 to dynamically detect RT signals and avoid generating compatibility
1669 functions with old kernel.
1670 * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
1671 __pthread_restart_new directly.
1672 (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
1673 __pthread_wait_for_restart_signal directly.
1674 (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
1675 __pthread_timedsuspend_new directly.
1677 2000-04-15 Ulrich Drepper <drepper@redhat.com>
1679 * condvar.c: Remove all the special code to handle cond_timedwait.
1680 Use timedsuspend instead.
1681 * internals.h: Declare __pthread_timedsuspend_old,
1682 __pthread_timedsuspend_new, and __pthread_timedsuspend.
1683 Remove declaration of __pthread_init_condvar.
1684 * pthread.c: Define __pthread_timedsuspend variable.
1685 (__pthread_timedsuspend_old): New function. Timed suspension
1686 implementation for old Linux kernels.
1687 (__pthread_timedsuspend_new): New function. Timed suspension
1688 implementation for new Linux kernels.
1689 * restart.h (timedsuspend): New function. Call appropriate
1690 suspension function through __pthread_timedsuspend.
1691 * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
1693 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1695 * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
1697 * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
1699 * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
1700 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1702 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
1703 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1705 2000-04-14 Andreas Jaeger <aj@suse.de>
1707 * weaks.c: Fix typo.
1709 * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
1710 2.2 for linuxthreads.
1712 2000-04-13 Ulrich Drepper <drepper@redhat.com>
1714 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1715 (pthread_getcpuclockid): Fix typo.
1717 2000-04-12 Ulrich Drepper <drepper@redhat.com>
1719 * Makefile (libpthread-routines): Add getcpuclockid.
1720 * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
1721 * sysdeps/pthread/getcpuclockid.c: New file.
1722 * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
1723 * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
1725 * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
1727 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1729 * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
1730 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1731 and pthread_spin_unlock.
1732 * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
1733 into pthread_spinlock_t. Change all uses.
1734 * spinlock.c: Implement pthread_spin_lock.
1735 Rename __pthread_unlock to __pthread_spin_unlock and define weak
1736 alias for real name.
1737 Define pthread_spin_trylock, pthread_spin_init, and
1738 pthread_spin_destroy.
1739 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1740 * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
1741 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1742 * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
1743 pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1744 and pthread_spin_unlock.
1745 * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
1746 Change all uses of _pthread_fastlock to pthread_spinlock_t.
1747 * condvar.c: Likewise.
1748 * internals.h: Likewise.
1750 * manager.c: Likewise.
1751 * mutex.c: Likewise.
1752 * pthread.c: Likewise.
1753 * rwlock.c: Likewise.
1754 * semaphore.c: Likewise.
1755 * signals.c: Likewise.
1757 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
1759 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1761 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1763 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
1764 _POSIX_SHARED_MEMORY_OBJECTS.
1766 2000-04-11 Andreas Jaeger <aj@suse.de>
1768 * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
1769 (__compare_and_swap): Mark as modifying memory.
1771 2000-04-11 Geoff Keating <geoffk@cygnus.com>
1773 * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
1775 (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
1776 Don't have the 'asm' __volatile__.
1778 2000-04-11 Ulrich Drepper <drepper@redhat.com>
1780 * internals.h: Define MEMORY_BARRIER as empty if not defined already.
1781 * spinlock.c (__pthread_lock): Add memory barriers.
1782 (__pthread_unlock): Likewise.
1783 * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
1785 (RELEASE): Not needed anymore.
1786 (__compare_and_swap): Mark asm as modifying memory.
1787 * sysdeps/powerpc/pt-machine.h (sync): Remove. Replace with definition
1789 (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
1790 * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
1791 (MEMORY_BARRIER): Define using stbar.
1792 * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
1794 (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
1795 Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
1796 Mike Burrows <m3b@pa.dec.com>.
1798 2000-04-09 Ulrich Drepper <drepper@redhat.com>
1800 * signals.c (sigaction): Fix return value for the case SIG is one
1801 of the signals the implementation uses.
1802 Patch by Xavier.Leroy@inria.fr.
1804 2000-04-01 Andreas Jaeger <aj@suse.de>
1806 * attr.c: Use shlib-compat macros.
1807 * oldsemaphore.c: Likewise.
1808 * pthread.c: Likewise.
1809 * weaks.c: Likewise.
1811 2000-03-26 Ulrich Drepper <drepper@redhat.com>
1813 * semaphore.c (sem_timedwait): New function.
1814 Patch by Carl Mailloux <carlm@oricom.ca>.
1815 * semaphore.h: Declare sem_timedwait.
1816 * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
1818 2000-03-26 Roland McGrath <roland@baalperazim.frob.com>
1820 * sysdeps/pthread/Makefile: File removed.
1822 2000-03-23 Ulrich Drepper <drepper@redhat.com>
1824 * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
1825 * internals.h (__pthread_reset_pthread_once): Add prototype.
1826 * ptfork.c (__fork): Call __pthread_reset_pthread_once.
1828 * manager.c (pthread_handle_create): Store ID of new thread before
1831 2000-03-21 Ulrich Drepper <drepper@redhat.com>
1833 * attr.c: Use new macros from shlib-compat.h to define versions.
1834 * oldsemaphore.c: Likewise.
1835 * semaphore.c: Likewise.
1836 * weaks.c: Likewise.
1838 * pthread.c: Update for new SHLIB_COMPAT definition.
1840 * manager.c (__pthread_manager): Unmask debug signal.
1842 * pthread.c (pthread_initialize): Test for address of __dso_handle
1843 being NULL, not value. Use __on_exit, not on_exit.
1844 Patch by Andreas Jaeger <aj@suse.de>.
1846 * pthread.c: Use new macros from shlib-compat.h to define versions.
1848 2000-03-19 Ulrich Drepper <drepper@redhat.com>
1850 * pthread.c (pthread_initialize): Instead of on_exit use
1851 __cxa_atexit if __dso_label is available to allow unloading the
1852 libpthread shared library.
1854 2000-03-16 Ulrich Drepper <drepper@redhat.com>
1856 * condvar.c: Make tests for ownership of mutex less strict.
1858 2000-03-14 Ulrich Drepper <drepper@redhat.com>
1860 * condvar.c (pthread_cond_wait): Check whether mutex is owned by
1861 current thread and return error if not.
1862 (pthread_cond_timedwait_relative_old): Likewise.
1863 (pthread_cond_timedwait_relative_new): Likewise.
1865 * mutex.c (__pthread_once): Handle cancelled init function correctly.
1866 (pthread_once_cancelhandler): New function.
1867 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1869 2000-03-14 Andreas Jaeger <aj@suse.de>
1871 * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
1873 (pthread_handle_sigrestart_rt): Likewise.
1874 * signals.c (pthread_sighandler_rt): Likewise.
1876 2000-03-02 Andreas Jaeger <aj@suse.de>
1878 * sysdeps/pthread/bits/libc-lock.h: Fix typo.
1879 Reported by Sean Chen <sean.chen@turbolinux.com>.
1881 2000-02-28 Andreas Jaeger <aj@suse.de>
1883 * rwlock.c: Fix typo.
1885 2000-02-27 Ulrich Drepper <drepper@redhat.com>
1887 * rwlock.c: Define __* variants of the functions and make old names
1889 * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
1890 * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
1892 2000-02-25 Andreas Jaeger <aj@suse.de>
1894 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1895 pwrite64, lseek64, open64, and __open64 with version 2.2.
1897 2000-02-22 Ulrich Drepper <drepper@redhat.com>
1899 * semaphore.h (SEM_FAILED): Use 0 not NULL.
1901 2000-02-14 Ulrich Drepper <drepper@redhat.com>
1903 * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
1904 nanosleep does not work either. Get absolute time inside the
1906 (pthread_cond_timedwait_relative_new): Likewise.
1907 Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1909 2000-02-13 Andreas Jaeger <aj@suse.de>
1911 * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
1912 (pthread_cond_timedwait_relative_old): Likewise.
1914 2000-02-13 Ulrich Drepper <drepper@redhat.com>
1916 * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
1917 but keep the code around. A bug in the kernel prevent us from
1919 (pthread_cond_timedwait_relative_new): Likewise.
1920 (PR libc/1597 and libc/1598).
1922 2000-02-01 Kaz Kylheku <kaz@ashi.footprints.net>
1924 * condvar.c (pthread_cond_timedwait_relative_old): Do tight
1925 loop around nanosleep calls instead of around most of the function
1926 (pthread_cond_timedwait_relative_new): Likewise.
1927 body. Got rid of backwards goto and one local.
1929 2000-01-31 Ulrich Drepper <drepper@redhat.com>
1931 * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
1932 before every nanosleep call to account for time spent in the rest
1934 (pthread_cond_timedwait_relative_new): Likewise.
1935 Patch by khendricks@ivey.uwo.ca (PR libc/1564).
1937 2000-01-29 Ulrich Drepper <drepper@redhat.com>
1939 * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
1940 from nanosleep call so that in case we restart we only wait for the
1942 (pthread_cond_timedwait_relative_new): Likewise.
1943 Patch by khendricks@ivey.uwo.ca (PR libc/1561).
1945 2000-01-18 Ulrich Drepper <drepper@cygnus.com>
1947 * manager.c (pthread_allocate_stack): Compute guard page address
1948 correctly. Patch by HJ Lu.
1950 * sysdeps/pthread/pthread.h: Define
1951 PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
1953 2000-01-16 Ulrich Drepper <drepper@cygnus.com>
1955 * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
1956 preference handling.
1957 (pthread_rwlockattr_setkind_np): Allow
1958 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
1959 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1961 2000-01-12 Ulrich Drepper <drepper@cygnus.com>
1963 * internals.h (pthread_readlock_info): New structure.
1964 (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
1965 p_untracked_readlock_count.
1966 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1967 Add initializers for new fields.
1968 * manager.c (pthread_free): Free read/write lock lists.
1969 * queue.h (queue_is_empty): New function.
1970 * rwlock.c: Implement requirements about when readers should get
1972 * sysdeps/pthread/pthread.h
1973 (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
1974 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
1975 Define this name as well.
1976 Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1978 2000-01-05 Ulrich Drepper <drepper@cygnus.com>
1980 * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1981 Adjust initializers for struct _pthread_descr_struct change.
1982 * internals.h (struct _pthread_descr_struct): Move new elements to
1985 2000-01-03 Kaz Kylheku <kaz@ashi.footprints.net>
1987 Redesigned how cancellation unblocks a thread from internal
1988 cancellation points (sem_wait, pthread_join,
1989 pthread_cond_{wait,timedwait}).
1990 Cancellation won't eat a signal in any of these functions
1991 (*required* by POSIX and Single Unix Spec!).
1992 * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
1993 simultaneous condition variable signal (not required by POSIX
1994 or Single Unix Spec, but nice).
1995 * spinlock.c: __pthread_lock queues back any received restarts
1996 that don't belong to it instead of assuming ownership of lock
1997 upon any restart; fastlock can no longer be acquired by two threads
1999 * restart.h: Restarts queue even on kernels that don't have
2000 queued real time signals (2.0, early 2.1), thanks to atomic counter,
2001 avoiding a rare race condition in pthread_cond_timedwait.
2003 1999-12-31 Andreas Jaeger <aj@suse.de>
2005 * internals.h: Remove duplicate prototype declarations.
2007 * weaks.c: Remove __THROW from prototypes since the file is not
2008 compiled by a C++ compiler.
2009 * internals.h: Likewise.
2011 1999-12-30 Andreas Jaeger <aj@suse.de>
2013 * sysdeps/pthread/pthread.h: Move internal functions to...
2014 * sysdeps/pthread/bits/libc-lock.h: ...here.
2016 1999-12-29 Andreas Jaeger <aj@suse.de>
2018 * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
2020 1999-12-28 Ulrich Drepper <drepper@cygnus.com>
2022 * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
2025 * manager.c (__pthread_start): Add one more cast to prevent
2026 warning on 64bit machines.
2028 1999-12-21 Ulrich Drepper <drepper@cygnus.com>
2030 * manager.c (pthread_handle_create): Set p_pid of new thread
2031 before calling the callback function to report a new thread.
2033 1999-12-20 Andreas Jaeger <aj@suse.de>
2035 * pthread.c (pthread_initialize): Move getrlimit call after
2038 1999-12-18 Ulrich Drepper <drepper@cygnus.com>
2040 * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
2041 pwrite64, lseek64, open64, and __open64.
2042 * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
2043 pwrite64, lseek64, open64, and __open64.
2045 * manager.c (pthread_allocate_stack): Correct computation of
2046 new_thread_bottom. Correct handling of stack size and when the
2047 rlimit method to guard for stack growth is used.
2048 * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
2049 minus one pagesize (not two).
2051 1999-12-03 Andreas Jaeger <aj@suse.de>
2053 * Versions: Add __res_state with version GLIBC_2.2.
2055 * errno.c (__res_state): New function to return thread specific
2058 * pthread.c (pthread_initialize): Initialize p_resp.
2059 (__pthread_reset_main_thread): Also set p_resp.
2061 * manager.c (pthread_handle_create): Initialize p_resp.
2063 * internals.h: Add thread specific resolver state.
2064 Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
2066 1999-12-01 Ulrich Drepper <drepper@cygnus.com>
2068 * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
2070 * sysdeps/i386/i686/pt-machine.h: Likewise.
2071 Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
2073 1999-11-23 Ulrich Drepper <drepper@cygnus.com>
2075 * manager.c (pthread_start_thread_event): Initialize p_pid already
2078 1999-11-22 Ulrich Drepper <drepper@cygnus.com>
2080 * internals.h: Add prototype for __pthread_manager_event.
2081 * manager.c (__pthread_manager_event): New function.
2082 (pthread_start_thread_event): Correct computation of self.
2083 Use INIT_THREAD_SELF.
2084 * pthread.c (__pthread_manager_thread): Initialize p_lock.
2085 (__pthread_initialize_manager): Respect event flags also for creation
2086 of the manager thread.
2088 1999-11-08 Ulrich Drepper <drepper@cygnus.com>
2090 * pthread.c (__pthread_initialize_manager): Initialize
2091 __pthread_manager_thread.p_tid.
2093 1999-11-02 Ulrich Drepper <drepper@cygnus.com>
2095 * internals.h: Declare __pthread_last_event.
2096 * manager.c: Define __pthread_last_event.
2097 (pthread_handle_create): Set __pthread_last_event.
2098 (pthread_exited): Likewise.
2099 * join.c (pthread_exit): Likewise.
2101 * Makefile (libpthread-routines): Add events.
2102 * events.c: New file.
2103 * internals.h: Protect against multiple inclusion.
2104 Include thread_dbP.h header.
2105 (struct _pthread_descr_struct): Add new fields p_report_events and
2107 Declare event reporting functions.
2108 * join.c (pthread_exit): Signal event if this is wanted.
2109 * manager.c (__pthread_threads_events): New variable.
2110 (pthread_handle_create): Take new parameters with event information.
2111 Signal TD_CREATE event if wanted.
2112 (__pthread_manager): Adjust pthread_handle_create call.
2113 (pthread_start_thread_event): New function. Block until manager is
2114 finished and then call pthread_start_thread.
2115 (pthread_exited): Signal TD_REAP event if wanted.
2117 1999-10-26 Ulrich Drepper <drepper@cygnus.com>
2119 * restart.h (suspend_with_cancellation): Rewrite as a macro.
2121 * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
2123 1999-10-25 Andreas Jaeger <aj@suse.de>
2125 * internals.h: Remove K&R compatibility.
2126 * no-tsd.c: Likewise.
2127 * semaphore.h: Likewise.
2128 * signals.c: Likewise.
2129 * sysdeps/pthread/bits/libc-tsd.h: Likewise.
2130 * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
2131 * weaks.c: Likewise.
2133 1999-10-21 Xavier Leroy <Xavier.Leroy@inria.fr>
2135 * pthread.c: For i386, wrap pthread_handle_sigrestart and
2136 pthread_handle_sigcancel with functions that restore %gs from the
2137 signal context. For each signal handling function, two wrappers
2138 are required, one for a non-RT signal and one for a RT signal.
2139 * signal.c: For i386, add code to restore %gs from the signal
2140 context in pthread_sighandler and pthread_sighandler_rt.
2142 1999-10-17 Ulrich Drepper <drepper@cygnus.com>
2144 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
2146 1999-10-14 Ulrich Drepper <drepper@cygnus.com>
2148 * pthread.c (__pthread_initial_thread): Pass argument to
2149 PTHREAD_START_ARGS_INITIALIZER.
2150 (__pthread_manager_thread): Likewise.
2152 * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
2153 initialize function.
2155 * manager.c (pthread_handle_create): Remove p_startfct initialization.
2157 * internals.h (_pthread_descr_struct): We don't need p_startfct field.
2159 1999-10-12 Ulrich Drepper <drepper@cygnus.com>
2161 * internals.h: Correct return types for __libc_read and __libc_write.
2163 1999-10-09 Andreas Jaeger <aj@suse.de>
2165 * internals.h: Add __new_sem_post to get prototype in
2166 manager.c; include semaphore.h for needed types.
2168 1999-10-08 Ulrich Drepper <drepper@cygnus.com>
2170 * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
2171 directly instead of calling sem_post which should not be necessary
2172 but is faster and might help in some case to work around problems.
2173 Patch by khendricks@ivey.uwo.ca [libc/1382].
2175 1999-10-08 Andreas Schwab <schwab@suse.de>
2177 * sysdeps/pthread/Subdirs: New file.
2180 1999-10-07 Ulrich Drepper <drepper@cygnus.com>
2182 * Implies: New file.
2183 * internals.h (struct _pthread_descr_struct): Add p_startfct.
2184 * manager.c (pthread_handle_create): Initialize p_startfct.
2185 * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
2187 1999-09-25 Ulrich Drepper <drepper@cygnus.com>
2189 * manager.c (__linuxthreads_pthread_threads_max): New variable.
2190 * specific.c (__linuxthreads_pthread_keys_max): New variable.
2191 (__linuxthreads_pthread_key_2ndlevel_size): New variable.
2193 * condvar.c (pthread_cond_timedwait_relative): Never return with
2194 EINTR. Patch by Andreas Schwab.
2196 1999-09-19 Ulrich Drepper <drepper@cygnus.com>
2198 * signals.c (sigaction): Correct last patch. Don't select
2199 pthread_sighandler_rt based on the signal number but instead of
2200 the SA_SIGINFO flag.
2202 1999-09-23 Ulrich Drepper <drepper@cygnus.com>
2204 * specific.c: Move definitions of struct pthread_key_struct and
2205 destr_function to ...
2206 * internals.h: ...here.
2208 1999-09-18 Ulrich Drepper <drepper@cygnus.com>
2210 * pthread.c (pthread_handle_sigrestart_rt): New function. Use
2211 this instead of pthread_handle_sigrestart if the signal is an RT
2214 * signals.c: Handle passing through of sighandler arguments also
2215 for real-time signals.
2217 1999-09-03 Andreas Schwab <schwab@suse.de>
2219 * ptfork.c (__fork): Renamed from fork and use __libc_fork. Add
2221 (__vfork): New function, alias vfork.
2222 * Versions: Export __fork, vfork, and __vfork in libpthread.
2224 1999-08-23 Andreas Schwab <schwab@suse.de>
2226 * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
2227 call to signal handler.
2229 1999-08-20 Ulrich Drepper <drepper@cygnus.com>
2231 * pthread.c (__pthread_reset_main_thread): Undo last change.
2232 (__pthread_kill_other_threads_np): Reset signal handlers for the
2233 signals we used in the thread implementation here.
2235 1999-08-19 Ulrich Drepper <drepper@cygnus.com>
2237 * pthread.c (__pthread_reset_main_thread): Reset signal handlers
2238 for the signals we used in the thread implementation [PR libc/1234].
2240 * Versions: Export __pthread_kill_other_threads_np from libpthread
2243 * signals.c: Pass sigcontext through wrapper to the user function.
2245 1999-08-01 Ulrich Drepper <drepper@cygnus.com>
2247 * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
2248 __libc_internal_tsd_set.
2250 1999-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2252 * manager.c: Remove inclusion of <linux/tasks.h> since it's not
2255 1999-07-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2257 * internals.h: Align _pthread_descr_struct to 32 bytes.
2258 Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
2261 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
2263 * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
2266 1999-07-09 Cristian Gafton <gafton@redhat.com>
2268 * Makefile (libpthread-routines): Add oldsemaphore routine.
2269 * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
2270 sem_trywait, and sem_wait to GLIBC_2.1.
2271 * oldsemaphore.c: New file.
2272 * semaphore.c: Add default_symbol_versions for the changed functions.
2273 (__new_sem_init): Rename from sem_init.
2274 (__new_sem_post): Rename from sem_post.
2275 (__new_sem_wait): Rename from sem_wait.
2276 (__new_sem_trywait): Rename from sem_trywait.
2277 (__new_sem_getvalue): Rename from sem_getvalue.
2278 (__new_sem_destroy): Rename from sem_destroy.
2280 1999-06-23 Robey Pointer <robey@netscape.com>
2282 * internals.h: Added p_nextlock entry to separate queueing for a
2283 lock from queueing for a CV (sometimes a thread queues on a lock
2284 to serialize removing itself from a CV queue).
2285 * pthread.c: Added p_nextlock to initializers.
2286 * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
2288 1999-07-09 Ulrich Drepper <drepper@cygnus.com>
2290 * manager.c (pthread_handle_create): Free mmap region after stack
2291 if clone failed. Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
2293 1999-05-23 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2295 * man/pthread_cond_init.man: Correct example.
2296 Reported by Tomas Berndtsson <tomas@nocrew.org>.
2298 * linuxthreads.texi (Condition Variables): Likewise.
2300 1999-05-18 Jakub Jelinek <jj@ultra.linux.cz>
2302 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
2303 casx not cas, also successful casx returns the old value in rd
2304 and not the new value.
2306 1999-05-16 Xavier Leroy <Xavier.Leroy@inria.fr>
2308 * manager.c: If pthread_create() is given a NULL attribute
2309 and the thread manager runs with a realtime policy, set the
2310 scheduling policy of the newly created thread back to SCHED_OTHER.
2311 * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
2312 initialize the schedpolicy field of new_thread->p_start_args
2313 to that of the calling thread.
2315 1999-04-29 Ulrich Drepper <drepper@cygnus.com>
2317 * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
2318 instruction does not allow memory element to use offset.
2320 1999-04-28 Ulrich Drepper <drepper@cygnus.com>
2322 * manager.c (pthread_allocate_stack): Optimize initialization of new
2325 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
2326 Don't use initializer since it is all zeroes.
2327 (__libc_once_define): Likewise.
2329 1999-04-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2331 * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
2332 doesn't exist anymore.
2333 * sysdeps/i386/Implies: Likewise.
2334 * sysdeps/m68k/Implies: Likewise.
2335 * sysdeps/mips/Implies: Likewise.
2336 * sysdeps/powerpc/Implies: Likewise.
2337 * sysdeps/sparc/sparc32/Implies: Likewise.
2338 * sysdeps/sparc/sparc64/Implies: Likewise.
2340 1999-04-15 Ulrich Drepper <drepper@cygnus.com>
2342 * sysdeps/alpha/bits/semaphore.h: Removed.
2343 * sysdeps/powerpc/bits/semaphore.h: Removed.
2344 * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
2345 * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
2346 * Makefile (headers): Remove bits/semaphore.h.
2348 * semaphore.h: Define _pthread_descr if necessary.
2349 Don't include limits.h. Define SEM_VALUE_MAX directly.
2351 (sem_t): Protect element names with leading __.
2352 Add declarations for sem_close, sem_open, and sem_unlink.
2353 * semaphore.c: Adjust all functions for new element names.
2354 Define sem_close, sem_open, and sem_unlink.
2355 * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
2357 * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
2360 1999-03-16 H.J. Lu <hjl@gnu.org>
2362 * specific.c (pthread_key_delete): Check th->p_terminated to see
2363 if the thread is running.
2365 * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
2366 Added to GLIBC_2.0 for libc.so.
2368 1999-02-12 H.J. Lu <hjl@gnu.org>
2370 * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
2371 __libc_allocate_rtsig): Added to GLIBC_2.1.
2373 * internals.h (DEFAULT_SIG_RESTART): Removed.
2374 (DEFAULT_SIG_CANCEL): Removed.
2376 * pthread.c (init_rtsigs, __libc_current_sigrtmin,
2377 __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
2378 (__pthread_sig_restart, __pthread_sig_cancel,
2379 __pthread_sig_debug): Initialized.
2380 (pthread_initialize): Call init_rtsigs () to initialize
2383 1999-02-03 H.J. Lu <hjl@gnu.org>
2385 * manager.c (__pthread_manager): Do block __pthread_sig_debug.
2386 Don't restart the thread which sent REQ_DEBUG.
2387 (pthread_start_thread): Check if __pthread_sig_debug > 0
2390 * pthread.c (__pthread_initialize_manager): Suspend ourself
2391 after sending __pthread_sig_debug to gdb instead of
2392 __pthread_sig_cancel.
2394 1999-01-24 H.J. Lu <hjl@gnu.org>
2396 * manager.c (__pthread_manager): Delete __pthread_sig_debug
2397 from mask if __pthread_sig_debug > 0.
2398 (pthread_handle_create): Increment __pthread_handles_num.
2400 * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
2401 * pthread.c (__pthread_initialize_manager): Likewise.
2403 * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
2404 instead of __libc_allocate_rtsig (2).
2405 (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
2406 instead of __pthread_sig_cancel.
2407 (pthread_handle_sigdebug): Fix comments.
2409 1999-01-21 Ulrich Drepper <drepper@cygnus.com>
2411 * manager.c (pthread_allocate_stack): Set
2412 __pthread_nonstandard_stacks if user-specified stack is used.
2414 1999-01-16 Ulrich Drepper <drepper@cygnus.com>
2416 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
2417 _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
2419 1999-01-07 Xavier Leroy <Xavier.Leroy@inria.fr>
2421 * pthread.c: Use a third signal __pthread_sig_debug distinct
2422 from __pthread_sig_cancel to notify gdb when a thread is
2424 * manager.c: Likewise.
2425 * internals.h: Likewise.
2426 * signals.c: The implementation of sigwait(s) assumed that
2427 all signals in s have signal handlers already attached.
2428 This is not required by the standard, so make it work
2429 also if some of the signals have no handlers.
2431 1999-01-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
2433 * linuxthreads.texi: Remove pointers from first @node. Move old
2434 @node spec inside comment.
2436 1998-12-31 Ulrich Drepper <drepper@cygnus.com>
2438 * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
2441 1998-12-29 Ulrich Drepper <drepper@cygnus.com>
2443 * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
2444 lock. Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
2446 1998-12-21 Ulrich Drepper <drepper@cygnus.com>
2448 * manager.c: Threads now send __pthread_sig_cancel on termination.
2449 Change clone call and signal masks.
2450 * thread.c (pthread_handle_sigrestart): Remove special code for
2452 (pthread_handle_sigcancel): In manager thread call
2453 __pthread_manager_sighandler.
2454 * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
2455 * sysdeps/i386/i686/pt-machine.h: Likewise.
2456 Patches by Xavier Leroy.
2458 1998-12-14 Ulrich Drepper <drepper@cygnus.com>
2460 * spinlock.c (__pthread_unlock): Don't crash if called for an
2461 untaken mutex. Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
2463 * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
2466 1998-12-13 Ulrich Drepper <drepper@cygnus.com>
2468 * Examples/ex3.c: Wait until all threads are started before
2469 searching for the number to avoid race condition on very fast
2472 1998-12-08 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2474 * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
2475 declaration since it's not needed.
2477 * sysdeps/pthread/pthread.h: Move internal functions to ...
2478 * internals.h: ...here.
2480 1998-12-02 H.J. Lu <hjl@gnu.org>
2482 * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
2483 SIGRTMIN is defined.
2484 (__pthread_sig_cancel): Likewise.
2486 1998-12-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2488 * wrapsyscall.c: Include <sys/mman.h> for msync,
2489 <stdlib.h> for system and <termios.h> for tcdrain prototype.
2490 Correct msync declaration.
2492 1998-11-29 Roland McGrath <roland@baalperazim.frob.com>
2494 * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
2495 __libc_tsd_set): New macros for new interface.
2496 * no-tsd.c: New file, provide uninitialized defns of
2497 __libc_internal_tsd_get and __libc_internal_tsd_set.
2498 * Makefile (routines): Add no-tsd.
2500 1998-10-12 Roland McGrath <roland@baalperazim.frob.com>
2502 * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
2503 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2504 __libc_internal_tsd_set): Move decls to ...
2505 * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
2508 * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2509 __libc_internal_tsd_set): Make these pointers to functions, not
2510 functions; remove #pragma weak decls for them.
2511 * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
2512 Define static functions and initialized pointers to them.
2514 1998-11-18 Ulrich Drepper <drepper@cygnus.com>
2516 * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
2517 (CFLAGS-specific.c): Likewise.
2518 (CFLAGS-pthread.c): Likewise.
2519 (CFLAGS-ptfork.c): Likewise.
2520 (CFLAGS-cancel.c): Likewise.
2521 * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
2522 as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
2524 * mutex.c (pthread_mutex_init): Define as strong symbol.
2525 (pthread_mutex_destroy): Likewise.
2526 (pthread_mutex_trylock): Likewise.
2527 (pthread_mutex_lock): Likewise.
2528 (pthread_mutex_unlock): Likewise.
2529 (pthread_mutexattr_init): Likewise.
2530 (pthread_mutexattr_destroy): Likewise.
2531 (pthread_once): Likewise.
2532 * ptfork.c (pthread_atfork): Likewise.
2533 * specific.c (pthread_key_create): Likewise.
2534 (pthread_setspecific): Likewise.
2535 (pthread_getspecific): Likewise.
2537 1998-11-15 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
2539 * linuxthreads.texi: Fix punctuation after xref.
2541 1998-11-10 H.J. Lu <hjl@gnu.org>
2543 * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
2544 if it is defined in <linux/limits.h>.
2546 1998-10-29 14:28 Ulrich Drepper <drepper@cygnus.com>
2548 * spinlock.h (__pthread_trylock): Define inline.
2549 (__pthread_lock): Add extra parameter to declaration. Declare
2550 using internal_function.
2551 (__pthread_unlock): Declare using internal_function.
2552 * spinlock.c (__pthread_lock): Add new parameter. Use it instead
2553 of local variable self. Avoid recomputing self. Define using
2555 (__pthread_trylock): Remove.
2556 (__pthread_unlock): Define using internal_function.
2557 * cancel.c: Adjust for __pthread_lock interface change. Use already
2558 computed self value is possible.
2559 * condvar.c: Likewise.
2561 * manager.c: Likewise.
2562 * mutex.c: Likewise.
2563 * pthread.c: Likewise.
2564 * rwlock.c: Likewise.
2565 * semaphore.c: Likewise.
2566 * signals.c: Likewise.
2568 1998-10-27 13:46 Ulrich Drepper <drepper@cygnus.com>
2570 * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
2571 __ to field names of the struct.
2572 * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
2574 (pthread_attr_t): Likewise.
2575 (pthread_cond_t): Likewise.
2576 (pthread_condattr_t): Likewise.
2577 (pthread_mutex_t): Likewise.
2578 (pthread_mutexattr_t): Likewise.
2579 (pthread_rwlock_t): Likewise.
2580 (pthread_rwlockattr_t): Likewise.
2581 * attr.c: Adjust for pthread.h and pthreadtypes.h change.
2582 * cancel.c: Likewise.
2583 * condvar.c: Likewise.
2584 * manager.c: Likewise.
2585 * mutex.c: Likewise.
2586 * pthread.c: Likewise.
2587 * ptlongjmp.c: Likewise.
2588 * rwlock.c: Likewise.
2589 * spinlock.c: Likewise.
2591 1998-10-09 Ulrich Drepper <drepper@cygnus.com>
2593 * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
2596 * sysdeps/i386/i686/pt-machine.h: Remove unused inline
2599 * Makefile (libpthread-routines): Add pt-machine.
2600 * pt-machine.c: New file.
2601 * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
2602 yet defined. Use PT_EI in extern inline definitions.
2603 * sysdeps/arm/pt-machine.h: Likewise.
2604 * sysdeps/i386/pt-machine.h: Likewise.
2605 * sysdeps/i386/i686/pt-machine.h: Likewise.
2606 * sysdeps/m68k/pt-machine.h: Likewise.
2607 * sysdeps/mips/pt-machine.h: Likewise.
2608 * sysdeps/powerpc/pt-machine.h: Likewise.
2609 * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
2610 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2612 1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2614 * semaphore.h: Include <sys/types.h> so that _pthread_descr
2617 1998-09-15 David S. Miller <davem@pierdol.cobaltmicro.com>
2619 * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
2621 * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
2623 1998-09-12 14:24 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2625 * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
2628 1998-09-02 11:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2630 * signals.c (sigaction): Check that sig is less than NSIG to avoid
2631 array index overflow.
2633 1998-09-06 10:56 Ulrich Drepper <drepper@cygnus.com>
2635 * sysdeps/pthread/semaphore.h: New file.
2637 1998-09-06 09:08 Ulrich Drepper <drepper@cygnus.com>
2639 * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
2640 _LIBC_TSD_KEY_DL_ERROR.
2642 1998-08-31 Ulrich Drepper <drepper@cygnus.com>
2644 * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
2645 * sysdeps/i386/pt-machine.h: Likewise.
2646 Suggested by Roland McGrath.
2648 1998-08-28 13:58 Ulrich Drepper <drepper@cygnus.com>
2650 * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
2651 access thread data with non-constant offsets.
2652 * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
2655 * sysdeps/i386/useldt.h: Fix typo. Add THREAD_GETMEM_NC and
2656 THREAD_SETMEM_NC definitions.
2658 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
2660 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2662 1998-08-26 15:46 Ulrich Drepper <drepper@cygnus.com>
2664 * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
2665 not already defined.
2666 (struct _pthread_descr_struct): Add p_self and p_nr field.
2667 * manager.c (__pthread_handles): Define second element to point
2669 (__pthread_handles_num): Initialize to 2.
2670 (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
2671 (pthread_start_thread): Likewise.
2672 (pthread_handle_create): Start search for free slot at entry 2.
2673 Initialize new fields p_self and p_nr.
2674 Call __clone with CLONE_PTRACE if available.
2675 (pthread_free): Call FREE_THREAD_SELF if available.
2676 * pthread.c (__pthread_initial_thread): Initialize new fields.
2677 (__pthread_manager_thread): Likewise.
2678 (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
2680 * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
2681 elements of the thread descriptor.
2682 * condvar.c: Likewise.
2683 * errno.c: Likewise.
2685 * manager.c: Likewise.
2686 * pthread.c: Likewise.
2687 * ptlongjmp.c: Likewise.
2688 * semaphore.c: Likewise.
2689 * signals.c: Likewise.
2690 * specific.c: Likewise.
2691 * spinlock.c: Likewise.
2693 * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
2695 * sysdeps/i386/useldt.h: New file.
2696 * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
2698 * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
2699 THREAD_SETMEM using __thread_self.
2700 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2702 1998-08-24 Geoff Keating <geoffk@ozemail.com.au>
2704 * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
2705 turned out that we didn't need to queue after all.
2707 1998-08-22 Geoff Keating <geoffk@ozemail.com.au>
2709 * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
2710 and wastes space; correct types.
2712 1998-08-08 11:18 H.J. Lu <hjl@gnu.org>
2714 * signals.c (sigaction): Handle NULL argument.
2716 1998-08-04 Ulrich Drepper <drepper@cygnus.com>
2718 * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
2721 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2723 * Makefile (linuxthreads-version): Extract correct number from
2726 1998-07-29 Xavier Leroy <Xavier.Leroy@inria.fr>
2728 * Banner: Bump version number to 0.8
2729 * FAQ.html: Many updates, in particular w.r.t. debugging.
2730 * manager.c: Support for non-default stacksize for
2731 LinuxThreads-allocated stacks;
2732 don't use guard pages for stacks with default size, rely on
2733 rlimit(RLIMIT_STACK) instead (it's cheaper).
2735 * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
2736 everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
2737 * condvar.c: Likewise.
2738 * internals.h: Likewise.
2739 * restart.h: Likewise.
2740 * signals.c: Likewise.
2741 * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
2743 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2745 * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
2746 __pthread_mutexattr_[sg]ettype. Add more weak aliases.
2747 * Versions: Put __pthread_mutexattr_settype under version
2748 GLIBC_2.0. Don't export __pthread_mutexattr_setkind_np and
2749 __pthread_mutexattr_gettype.
2751 1998-07-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2753 * sysdeps/pthread/bits/libc-lock.h: Make
2754 __pthread_mutexattr_settype weak. Don't make
2755 __pthread_mutexattr_setkind_np weak.
2757 1998-07-16 10:52 Ulrich Drepper <drepper@cygnus.com>
2759 * manager.c (pthread_handle_create): Check whether sched_setscheduler
2760 call can succeed here.
2762 * mutex.c: Define __pthread_mutexattr_settype and make
2763 __pthread_mutexattr_setkind_np an alias.
2764 Likewise for __pthread_mutexattr_gettype.
2766 1998-07-15 11:00 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
2768 * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
2771 1998-07-14 19:38 Ulrich Drepper <drepper@cygnus.com>
2773 * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
2775 1998-07-11 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2777 * Examples/ex6.c: Include <unistd.h> for usleep.
2779 1998-06-13 11:04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2781 * Examples/ex4.c (main): Use exit, not pthread_exit.
2783 1998-07-09 13:39 Ulrich Drepper <drepper@cygnus.com>
2785 * Versions: Add __pthread_mutexattr_gettype and
2786 __pthread_mutexattr_settype.
2787 * lockfile.c: Use __pthread_mutexattr_settype instead of
2788 __pthread_mutexattr_setkind_np.
2789 * mutex.c: Define __pthread_mutexattr_gettype and
2790 __pthread_mutexattr_settype.
2792 * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
2793 __pthread_mutexattr_settype.
2794 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
2795 Use __pthread_mutexattr_settype.
2797 1998-07-08 22:26 Ulrich Drepper <drepper@cygnus.com>
2799 * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
2800 * mutex.c: Define weak alias pthread_mutexattr_gettype and
2801 pthread_mutexattr_settype.
2802 * sysdeps/pthread/pthread.h: Declare these functions.
2803 Move pthread_sigmask and pthread_kill declaration in separate header.
2804 * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
2806 1998-07-07 15:20 Ulrich Drepper <drepper@cygnus.com>
2808 * Makefile: Add rules to compile and run tests.
2809 * Examples/ex1.c: Little changes to fix warnings.
2810 * Examples/ex2.c: Likewise.
2811 * Examples/ex3.c: Likewise.
2812 * Examples/ex4.c: Likewise.
2813 * Examples/ex5.c: Likewise.
2814 * Examples/ex6.c: New file.
2816 1998-07-05 11:54 Ulrich Drepper <drepper@cygnus.com>
2818 * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
2820 1998-07-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2822 * attr.c: Include <string.h>.
2824 1998-06-30 11:47 Ulrich Drepper <drepper@cygnus.com>
2826 * attr.c: Include errno.h. Use memcpy to copy sched_param.
2827 * internals.h: Include limits.h.
2828 * manager.c: Use memcpy to copy sched_param.
2829 * ptfork.c: Include errno.h.
2830 * pthread.c: Likewise.
2831 * semaphore.c: Likewise.
2832 * specific.c: Likewise.
2833 * spinlock.h: Likewise.
2834 * sysdeps/pthread/pthread.h: Include only allowed headers. Move
2835 type definition to ...
2836 * sysdeps/pthread/bits/pthreadtypes.h: ...here. New file.
2838 1998-06-29 12:34 Ulrich Drepper <drepper@cygnus.com>
2840 * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
2842 * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
2843 as macros as demanded in POSIX.1, Annex C.
2845 1998-06-29 12:29 Ulrich Drepper <drepper@cygnus.com>
2847 * internals.h (struct pthread_request): For free use pthread_t
2848 instead of pthread_descr.
2849 * join.c (pthread_join): Pass thread_id, not th to manager.
2850 (pthread_detach): Likewise.
2851 * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
2852 (pthread_exited): Remove detached queue code.
2853 (pthread_handle_free): Expect thread ID parameter and use it to
2854 validate the thread decsriptor. Don't use detached queue.
2855 Patches by Xavier Leroy.
2857 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2859 * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
2860 _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
2861 __pthread_atfork, __pthread_key_create, __pthread_once.
2862 * internals.h: Doc fix.
2863 * pthread.c (__pthread_initialize): Define again.
2865 1998-06-26 Ulrich Drepper <drepper@cygnus.com>
2867 * manager.c (pthread_exited): If thread is not detached put it on
2869 (pthread_handle_free): If thread is not on list with living threads
2870 search on list with detached threads.
2872 * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
2873 for new definition of pthread_rwlock_t.
2875 * spinlock.c: Correct test whether to compile
2876 __pthread_compare_and_swap or not.
2878 1998-06-25 19:27 Ulrich Drepper <drepper@cygnus.com>
2880 * attr.c: Finish user stack support. Change locking code to be safe
2881 in situations with different priorities.
2882 * cancel.c: Likewise.
2883 * condvar.c: Likewise.
2884 * internals.h: Likewise.
2886 * manager.c: Likewise.
2887 * mutex.c: Likewise.
2888 * pthread.c: Likewise.
2889 * ptlongjmp.c: Likewise.
2890 * queue.h: Likewise.
2891 * rwlock.c: Likewise.
2892 * semaphore.c: Likewise.
2893 * semaphore.h: Likewise.
2894 * signals.c: Likewise.
2895 * spinlock.c: Likewise.
2896 * spinlock.h: Likewise.
2897 * sysdeps/pthread/pthread.h: Likewise.
2898 Patches by Xavier Leroy.
2900 * sysdeps/i386/i686/pt-machine.h: New file.
2902 1998-06-25 Ulrich Drepper <drepper@cygnus.com>
2904 * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
2905 [sg]et_stackaddr prototypes always available.
2907 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2908 _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
2910 1998-06-24 Ulrich Drepper <drepper@cygnus.com>
2912 * manager.c (pthread_free): Undo patch from 980430.
2913 Reported by David Wragg <dpw@doc.ic.ac.uk>.
2915 1998-06-09 15:07 Ulrich Drepper <drepper@cygnus.com>
2917 * manager.c: Define __pthread_manager_adjust_prio and use it to
2918 increase priority when needed.
2919 * internals.h: Add prototype for __pthread_manager_adjust_prio.
2920 * mutex.c: Optimize mutexes to wake up only one thread.
2921 * pthread.c: Move PID of manager for global variable in structure
2923 Patches by Xavier Leroy.
2925 1998-06-07 13:47 Ulrich Drepper <drepper@cygnus.com>
2927 * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
2929 1998-06-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
2931 * attr.c: Correct typo.
2933 1998-05-01 Ulrich Drepper <drepper@cygnus.com>
2935 * manager.c (pthread_free): Unmap guard before the stack.
2936 Patch by Matthias Urlichs.
2938 1998-04-30 Ulrich Drepper <drepper@cygnus.com>
2940 * manager.c (pthread_free): Detect already free child.
2941 Patch by Xavier Leroy, reported by Matthias Urlichs.
2943 1998-04-23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2945 * Makefile (linuxthreads-version): Renamed back from
2948 1998-04-21 Ulrich Drepper <drepper@cygnus.com>
2950 * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
2953 1998-04-20 14:55 Ulrich Drepper <drepper@cygnus.com>
2955 * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
2956 * internals.h: Add definitions for new spinlock implementation.
2957 * ptlongjmp.c: New file.
2958 * spinlock.c: New file.
2959 * spinlock.h (acquire): Don't reschedule using __sched_yield, use
2960 new function __pthread_acquire to prevent deadlocks with thread
2961 with different priorities.
2962 Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
2964 1998-03-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2966 * manager.c (__pthread_manager): Reduce first argument to select
2967 to include just the needed file descriptor.
2969 1998-03-17 00:06 Ulrich Drepper <drepper@cygnus.com>
2971 * manager.c: Fix last patch which caused core dumps.
2973 * pthread.c: Correctly handle missing SIGRTMIN.
2975 1998-03-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2977 * libpthread.map: Add __libc_internal_tsd_get and
2978 __libc_internal_tsd_set. Add missing cancelable functions. Export
2979 libc internal versions of the cancelable functions.
2981 1998-03-13 16:51 Ulrich Drepper <drepper@cygnus.com>
2983 * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
2985 1998-03-13 00:46 Ulrich Drepper <drepper@cygnus.com>
2987 * attr.c: Implement pthread_attr_[gs]etguardsize,
2988 pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
2989 Change pthread_attr_init to have two interfaces.
2990 * internals.h (struct _pthread_descr_struct): Add new fields for
2992 * libpthread.map: Add names in GLIBC_2.1 section.
2993 * manager.c (pthread_handle_create): Implement guardsize and
2995 (pthread_free): Likewise.
2996 * pthread.c (pthread_create): Add new interface for changed
2998 * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2999 * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
3002 1998-03-11 00:42 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
3004 * manager.c: Enable resetting of the thread scheduling policy
3005 to SCHED_OTHER when the parent thread has a different one.
3007 1998-02-01 13:51 Ulrich Drepper <drepper@cygnus.com>
3009 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3010 _POSIX_ASYNCHRONOUS_IO.
3012 * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
3014 * mutex.c: Implement new mutex types.
3016 * internals.h: Include <signal.h>.
3018 * libpthread.map: Add __erno_location and __h_errno_location.
3020 * errno.c: Return pointer to variable actually in use. This might
3021 not be the one in the thread structure.
3022 * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
3024 * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
3025 of manager thread structure.
3026 (pthread_handle_create): Set p_errnop and p_h_errnop members for new
3028 * pthread.c: Adapt initializer for thread structures.
3029 (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
3030 (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
3031 current thread to global variables.
3033 1998-01-31 17:27 Ulrich Drepper <drepper@cygnus.com>
3035 * rwlock.c: New file.
3036 * Makefile (libpthread-routines): Add rwlock.
3037 * sysdeps/pthread/pthread.h: Define data structures and declare
3039 * libpthread.map: Add new functions.
3041 1997-12-18 13:50 Philip Blundell <pb@nexus.co.uk>
3043 * sysdeps/arm/pt-machine.h: New file; add ARM support.
3044 * sysdeps/arm/Implies: likewise.
3045 * README: Document it.
3047 1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3049 * signals.c: Remove unneeded initializer for sigwaited, saving a
3052 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3054 * semaphore.c (sem_init): Set sem_spinlock only if available.
3056 1997-12-04 01:48 Ulrich Drepper <drepper@cygnus.com>
3058 * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
3059 * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
3061 * Makefile: Update from LinuxThreads 0.7.
3062 * internals.h. Likewise.
3063 * manager.c: Likewise.
3064 * mutex.c: Likewise.
3065 * pthread.c: Likewise.
3066 * signals.c: Likewise.
3067 * specific.c: Likewise.
3068 * Examples/ex3.c: Likewise.
3070 1997-11-20 18:13 Ulrich Drepper <drepper@cygnus.com>
3072 * pthread.c (__pthread_reset_main_thread): Close pipe only if still
3075 1997-10-29 05:38 Ulrich Drepper <drepper@cygnus.com>
3077 * wrapsyscall.c: Add socket functions which are also cancelation
3080 1997-10-19 21:40 Wolfram Gloger <wg@wolfram.dent.med.uni-muenchen.de>
3082 * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
3083 New functions for fast thread specific data within libc.
3085 * internals.h: Add new array p_libc_specific to struct
3086 _pthread_descr_struct.
3088 * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
3090 1997-10-13 05:39 Ulrich Drepper <drepper@cygnus.com>
3092 * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
3093 Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
3095 1997-08-29 03:05 Ulrich Drepper <drepper@cygnus.com>
3097 * internals.h (struct _pthread_descr_struct): Add definitions for
3098 two-level specific key handling.
3099 * manager.c (pthread_handle_create): Initialize specific memory array.
3100 * specific.c: Implement two-level key handling.
3101 * weaks.c: Don't provide dummy key handling.
3102 * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
3103 Add definition of __libc_key_t.
3104 * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
3106 Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
3107 PTHREAD_DESTRUCTOR_ITERATIONS.
3109 * manager.c (pthread_handle_create): Compare mmap result with
3112 * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
3113 * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
3115 1997-08-22 19:04 Richard Henderson <rth@cygnus.com>
3117 sysdeps/sparc -> sysdeps/sparc/sparc32
3118 sysdeps/sparc64 -> sysdeps/sparc/sparc64
3120 * internals.h: Change definition of THREAD_SELF to be an expression,
3121 not a statement that did a return.
3122 * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
3123 * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
3124 Follow Solaris and use a "system reserved" register (%g6) to hold
3125 the thread descriptor.
3126 * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
3128 1997-08-03 00:09 Ulrich Drepper <drepper@cygnus.com>
3130 * mutex.c: Correct pthread_once. Patch by Xavier Leroy.
3131 * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
3132 * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
3134 * semaphore.c: Include spinlock.h only when needed.
3136 * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
3137 keys for entries not in use.
3139 * weaks.c: Implement key handling functions for real.
3141 1997-06-29 01:04 Richard Henderson <richard@gnu.ai.mit.edu>
3143 Initial sparc64-linux support:
3144 * sysdeps/sparc64/Implies: New file.
3145 * sysdeps/sparc64/pt-machine.h: Likewise.
3147 1997-06-29 00:48 Ulrich Drepper <drepper@cygnus.com>
3149 * semaphore.c: Include spinlock.h at correct place.
3152 1997-06-13 10:06 Richard Henderson <rth@tamu.edu>
3154 The Great Bit File Move:
3155 * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
3156 * sysdeps/powerpc/semaphorebits.h: Likewise.
3157 * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
3158 * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
3159 * sysdeps/pthread/libc-lock.h: -> bits/
3160 * sysdeps/pthread/stdio-lock.h: Likewise.
3161 * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
3162 * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
3163 * semaphore.h: Likewise.
3164 * sysdeps/pthread/pthread.h: Likewise.
3166 * lockfile.c: <foo.h> -> <bits/foo.h>.
3167 * semaphore.h: Likewise.
3169 * Makefile: (headers): foo.h -> bits/foo.h.
3170 * sysdeps/pthread/Makefile: Likewise.
3172 1997-04-11 01:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3174 * semaphore.c (sem_init): Set sem_spinlock only if available.
3176 * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
3179 1997-04-09 03:00 Ulrich Drepper <drepper@cygnus.com>
3181 Update from LinuxThreads 0.6.
3183 * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
3184 and __sched_get_priority_min instead of names without `__'.
3186 * manager.c: Rewrite large parts to implement opaque pthread_t.
3188 * cancel.c: Adapt for opaque pthread_t type.
3189 * condvar.c: Likewise.
3190 * errno.c: Likewise.
3192 * mutex.c: Likewise.
3193 * pthread.c: Likewise.
3194 * signals.c: Likewise.
3195 * specific.c: Likewise.
3196 * restart.h: Likewise.
3197 * queue.h: Likewise.
3198 * Examples/ex3.c: Likewise.
3199 * Examples/ex4.c: Likewise.
3200 * sysdeps/pthread/pthread.h: Likewise.
3202 * pthread.c: Accumulate time for all threads in thread manager.
3204 * semaphore.c: Implement fallback implementation for architectures
3205 sometimes missing compare-exchange operations.
3207 * cancel.c (pthread_cancel): Validate handle argument.
3208 * join.c (pthread_join): Likewise.
3209 (pthread_detach): Likewise.
3210 * signals.c (pthread_kill): Likewise.
3212 * spinlock.h (acquire): Use __sched_yield not sched_yield.
3214 * queue.h (enqueue): Enqueue thread according to priority.
3216 * internals.c (struct pthread_start_args): New struct for passing
3217 args to cloning function.
3218 (struct _pthread): Rename to _pthread_descr_struct and adapt for
3221 * Examples/Makefile (clean): Pass -f option to rm.
3223 * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
3224 and define TEST_FOR_COMPARE_AND_SWAP.
3225 * sysdeps/i386/i486/pt-machine.h: Removed.
3227 * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
3230 1997-04-04 16:38 Ulrich Drepper <drepper@cygnus.com>
3232 * restart.h (suspend): Clear p_signal before suspending.
3233 (suspend_with_cancellation): Likewise.
3234 Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
3236 * weaks.c: Make __pthread_key_create return 1.
3237 * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
3238 __libc_getspecific, __libc_setspecific, and __libc_key_t.
3239 * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
3242 1997-03-19 15:13 Miguel de Icaza <miguel@nuclecu.unam.mx>
3244 * sysdeps/sparc/pt-machine (RELEASE): Fix.
3246 1997-03-01 07:55 Geoff Keating <geoffk@ozemail.com.au>
3248 * sysdeps/powerpc/Implies: Added.
3249 * sysdeps/powerpc/pt-machine.h: Added.
3250 * sysdeps/powerpc/semaphorebits.h: Added.
3252 1997-01-22 01:22 Ulrich Drepper <drepper@cygnus.com>
3254 * pthread.c (__pthread_initial_thread): Correct
3256 (__pthread_manager_thread): Likewise.
3257 Reported by Andreas Jaeger.
3259 1997-01-18 22:15 Richard Henderson <rth@tamu.edu>
3261 Since sigset_t no longer fits in a register, we can't pass in the
3262 thread's initial mask so easily. Take this opportunity to simplify
3263 the clone implementation by only accepting a single void* argument.
3265 * manager.c (__pthread_manager): Put thread vitals in the thread
3266 struct instead of as arguments through clone.
3267 (pthread_start_thread): Look for them there.
3268 * internals.h (struct _pthread): Add p_initial_fn,
3269 p_initial_fn_arg, p_initial_mask. Fix __pthread_manager proto.
3270 * pthread.c (pthread_initialize_manager): Revise clone invocation.