Update.
[platform/upstream/glibc.git] / linuxthreads / ChangeLog
1 2001-02-26  Jakub Jelinek  <jakub@redhat.com>
2
3         * signals.c (pthread_sighandler): Use CALL_SIGHANDLER.
4
5 2001-02-23  Jakub Jelinek  <jakub@redhat.com>
6
7         * internals.h (__pthread_init_max_stacksize): New prototype.
8         * attr.c (__pthread_attr_setstacksize): Call
9         __pthread_init_max_stacksize if not yet initialized.
10         * pthread.c (__pthread_init_max_stacksize): New function.
11         (__pthread_initialize_manager): Call it.
12         Patch by <dtc@cmucl.cons.org>.
13
14 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
15
16         * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64.
17
18 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
19
20         * shlib-versions: Add rule for Linux on 64 bit S/390.
21         * sysdeps/s390/s390-64/pt-machine.h: New file.
22         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
23
24 2001-03-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
25
26         * sysdeps/s390/pt-machine.h: Move to...
27         * sysdeps/s390/s390-32/pt-machine.h: ...here.
28         Add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE.
29
30 2001-03-15  Ulrich Drepper  <drepper@redhat.com>
31
32         * Versions [libpthread] (GLIBC_2.2.3): Add pthread_getattr_np.
33         * attr.c: Implement pthread_getattr_np.
34         * sysdeps/pthread/pthread.h: Add prototype for pthread_getattr_np.
35         * internals.h (struct _pthread_descr_struct): Add p_inheritsched.
36         * manager.c (pthread_handle_create): Initialize p_inheritsched.
37
38 2001-03-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
39
40         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: Use 0x07 padding for
41         code alignment.
42
43 2001-02-20  Hans Boehm  <hans_boehm@hp.com>
44
45         * manager.c (manager_mask): Removed static vesion.  Now always local
46         to __pthread_manager().
47         (manager_mask_all): Removed completely.
48         (__pthread_manager): Remove manager_mask_all initialization.
49         (pthread_handle_create): Remove code to set and reset signal mask
50         around __clone2() calls.
51
52 2001-02-17  Jakub Jelinek  <jakub@redhat.com>
53
54         * spinlock.c (__pthread_lock): Force lock->__status to be read from
55         memory on every spin.
56
57 2001-02-10  Andreas Jaeger  <aj@suse.de>
58
59         * Makefile (extra-objs): New.
60
61 2001-02-09  Jakub Jelinek  <jakub@redhat.com>
62
63         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Add
64         __pthread_initialize_minimal prototype.
65
66 2001-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
67
68         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
69
70 2001-02-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
71
72         * sysdeps/unix/sysv/linux/s390/pt-initfini.c: New file.
73
74 2001-02-06  Ulrich Drepper  <drepper@redhat.com>
75
76         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: First attempt to fix the
77         broken code.  Patch by Jes Sorensen.
78
79 2001-02-06  Andreas Jaeger  <aj@suse.de>
80
81         * sysdeps/pthread/pthread.h: Move __pthread_initialize from here
82         to...
83         * internals.h: ...here.
84
85 2001-02-05  Jes Sorensen  <jes@linuxcare.com>
86
87         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
88
89 2001-02-02  Ulrich Drepper  <drepper@redhat.com>
90
91         * Versions: Remove __pthread_initialize_minimal.
92
93 2001-02-01  Ulrich Drepper  <drepper@redhat.com>
94
95         * Makefile: Add rules to build crti.o and make it being used in
96         building libpthread.so.
97         * sysdeps/i386/Makefile: New file.
98         * sysdeps/pthread/pt-initfini.c: New file.
99
100         * pthread.c: Cleanups.
101
102 2001-01-28  Andreas Jaeger  <aj@suse.de>
103
104         * oldsemaphore.c (__old_sem_init): Adjust for last change.
105         * sysdeps/pthread/bits/libc-lock.h: Likewise.
106         * spinlock.c: Likewise.
107
108 2001-01-28  Ulrich Drepper  <drepper@redhat.com>
109
110         * sysdeps/pthread/bits/initspin.h: Make all names namespace clean.
111         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: Likewise.
112         * manager.c: Adjust for namespace cleanup in bits/initspin.h.
113         * pthread.c: Likewise.
114         * spinlock.h: Likewise.
115         * sysdeps/pthread/pthread.h: Likewise.
116
117 2001-01-26  Ulrich Drepper  <drepper@redhat.com>
118
119         * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
120         as struct __pthread_attr_s.
121
122         * semaphore.h (sem_t): Cleanup namespace, rename status and
123         spinlock elements.
124
125 2001-01-13  Jakub Jelinek  <jakub@redhat.com>
126
127         * pthread.c (pthread_onexit_process): Clear
128         __pthread_manager_thread_bos after freeing it.
129         * Makefile (tests): Add ex16.
130         * Examples/ex16.c: New file.
131
132 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
133
134         * Makefile (CFLAGS-pthread.c): Pass -DHAVE_Z_NODELETE if ld supports
135         -z nodelete.
136         * pthread.c (pthread_exit_process): Rename to...
137         (pthread_onexit_process): ...this.
138         (pthread_atexit_process, pthread_atexit_retcode): New.
139         (pthread_initialize): Call __cxa_atexit instead of __cxa_on_exit
140         and only if HAVE_Z_NODELETE is not defined.
141         (__pthread_initialize_manager): Register pthread_atexit_retcode
142         with __cxa_atexit.
143
144 2001-01-11  Ulrich Drepper  <drepper@redhat.com>
145
146         * pthread.c (pthread_initialize): Use __cxs_on_exit not __cxa_atexit.
147
148 2001-01-11  Jakub Jelinek  <jakub@redhat.com>
149
150         * Makefile (tests): Add ex15.
151         * Examples/ex15.c: New test.
152
153 2001-01-08  Ulrich Drepper  <drepper@redhat.com>
154
155         * pthread.c (pthread_exit_process): Free memory allocated for
156         manager stack.
157
158 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
159
160         * manager.c (pthread_alloca_stack): Remove MAP_FIXED from mmap calls.
161         (pthread_free): Always unmap the stack.  It's safe now that we don't
162         use MAP_FIXED to allocate stacks.
163
164 2000-12-31  Ulrich Drepper  <drepper@redhat.com>
165
166         * sysdeps/powerpc/pspinlock.c: Don't include pt-machine.h here.
167
168         * manager.c (pthread_allocate_stack): Prepare for removal of MAP_FIXED.
169
170 2000-11-15  Wolfram Gloger  <wg@malloc.de>
171
172         * manager.c (pthread_free): [!FLOATING_STACKS]: Only remap the
173         stack to PROT_NONE, don't unmap it, avoiding collisions with malloc.
174
175 2000-12-27  Andreas Jaeger  <aj@suse.de>
176
177         * Examples/ex13.c: Make local functions static.
178         * ecmutex.c: Likewise.
179         * joinrace.c: Likewise.
180         * Examples/ex14.c: Likewise.
181
182         * Examples/ex2.c: Make local functions static; reformat.
183         * Examples/ex1.c: Likewise.
184         * Examples/ex4.c: Likewise.
185         * Examples/ex5.c: Likewise.
186         * Examples/ex7.c: Likewise.
187
188         * oldsemaphore.c: Add prototypes to shut up GCC.
189         * pt-machine.c: Likewise.
190
191         * weaks.c: Add prototype for pthread_exit.
192
193         * internals.h: Add some prototypes, format prototypes and add
194         missing externs.
195         Move __libc_waitpid prototype to include/sys/wait.h.
196
197         * rwlock.c: Include <bits/libc-lock.h> for prototypes.
198         * mutex.c: Likewise.
199         * specific.c: Likewise.
200         * ptfork.c: Likewise.
201
202         * lockfile.c: Include internals.h to get prototypes.
203         * events.c: Likewise.
204         * sysdeps/alpha/pspinlock.c: Likewise.
205         * sysdeps/arm/pspinlock.c: Likewise.
206         * sysdeps/hppa/pspinlock.c: Likewise.
207         * sysdeps/i386/pspinlock.c: Likewise.
208         * sysdeps/ia64/pspinlock.c: Likewise.
209         * sysdeps/m68k/pspinlock.c: Likewise.
210         * sysdeps/mips/pspinlock.c: Likewise.
211         * sysdeps/powerpc/pspinlock.c: Likewise.
212         * sysdeps/s390/pspinlock.c: Likewise.
213         * sysdeps/sh/pspinlock.c: Likewise.
214         * sysdeps/sparc/sparc32/pspinlock.c: Likewise.
215         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: Likewise.
216         * sysdeps/sparc/sparc64/pspinlock.c: Likewise.
217
218 2000-12-27  Ulrich Drepper  <drepper@redhat.com>
219
220         * attr.c (__pthread_attr_setstack): Fix setting of __stackaddr element.
221         (__pthread_attr_getstack): Return correct address.
222         Add warnings for using pthread_attr_getstackaddr and
223         pthread_attr_setstackaddr.
224
225 2000-12-26  Ulrich Drepper  <drepper@redhat.com>
226
227         * Examples/ex6.c (test_thread): Make static.
228         * Examples/ex12.c (test_thread): Make static and add noreturn
229         attribute.
230
231 2000-12-18  Jes Sorensen  <jes@linuxcare.com>
232
233         * linuxthreads/sysdeps/ia64/pt-machine.h: __compare_and_swap
234         and compare_and_swap_with_release_semantics returns int not long.
235
236 2000-12-17  Andreas Jaeger  <aj@suse.de>
237
238         * sysdeps/s390/pt-machine.h (testandset): Use long int as return
239         value.
240         * sysdeps/arm/pt-machine.h (testandset): Likewise.
241         * sysdeps/hppa/pt-machine.h (testandset): Likewise.
242         * sysdeps/m68k/pt-machine.h (testandset): Likewise.
243         * sysdeps/sh/pt-machine.h (testandset): Likewise.
244         * sysdeps/sparc/sparc32/pt-machine.h (testandset): Likewise.
245         * sysdeps/sparc/sparc64/pt-machine.h (testandset): Likewise.
246
247 2000-12-17  Ulrich Drepper  <drepper@redhat.com>
248
249         * sysdeps/i386/pt-machine.h (testandset): Adjust for prototype change.
250         * sysdeps/i386/i686/pt-machine.h (testandset): Likewise.
251
252 2000-12-17  Andreas Jaeger  <aj@suse.de>
253
254         * internals.h: Add prototypes for testandset and
255         __compare_and_swap to shut up gcc warnings.
256
257 2000-12-06  Wolfram Gloger  <wg@malloc.de>
258
259         * join.c (pthread_detach): Allow case where the thread has already
260         terminated.
261
262 2000-12-05  Andreas Jaeger  <aj@suse.de>
263
264         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't set mips2.
265         * sysdeps/mips/pt-machine.h (testandset): Likewise.
266         (__compare_and_swap): Likewise.
267         Patches by Maciej W. Rozycki <macro@ds2.pg.gda.pl>.
268
269 2000-11-20  Jakub Jelinek  <jakub@redhat.com>
270
271         * Examples/ex3.c (main): Cast int to long before casting to void *.
272         (search): Cast void * to long, not int.
273         * Examples/ex8.c (main, thread): Similarly.
274         * Examples/ex11.c (main): Similarly.
275         * Examples/ex14.c (worker, do_test): Similarly.
276         * ecmutex.c (worker, do_test): Similarly.
277         (nlocks): Cast to int.
278
279 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
280
281         * linuxthreads.texi:  Add documentation for pthreads attributes
282         guardsize, stackaddr, stacksize, and stack.  Fix typo in previous
283         patch.  Document pthread_[sg]etconcurrency().  Mark
284         pthread_mutexattr_[sg]ettype() as POSIX rather than GNU.
285
286 2000-11-07  Ulrich Drepper  <drepper@redhat.com>
287
288         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
289         Don't define it.
290         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
291         Reported by Christopher Yeoh <cyeoh@linuxcare.com.au>.
292
293 2000-11-06  Ulrich Drepper  <drepper@redhat.com>
294
295         * cancel.c (pthread_cancel): Always set p_canceled, even if we are
296         not doing it right now.
297         Reported by Kaz Kylheku <kaz@ashi.footprints.net>.
298
299 2000-10-30  Ulrich Drepper  <drepper@redhat.com>
300
301         * Examples/ex4.c (main): Don't use exit() to avoid warning with
302         broken compilers.
303
304 2000-10-29  Ulrich Drepper  <drepper@redhat.com>
305
306         * attr.c (__pthread_attr_setguardsize): Don't round guardsize
307         here.  Reported by Bruce Mitchener <bruce@cubik.org>.
308
309         * linuxthreads.texi: Changes terminology to 'type' from 'kind' when
310         discussing mutexes. (As per the Unix98 name for the API.)
311         Changes documentation for pthread_mutexattr_setkind_np() and
312         pthread_mutexattr_getkind_np() over to the Unix98 APIs for the
313         same: pthread_mutexattr_settype() and pthread_mutexattr_gettype().
314         Changes references to PTHREAD_MUTEXATTR_FAST_NP to
315         PTHREAD_MUTEXATTR_ADAPTIVE_NP.
316         Begins to introduce discussion of the ``timed'' mutex type.  This
317         discussion is currently incomplete.
318         Patch by Bruce Mitchener <bruce@cubik.org>.
319
320 2000-10-26  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
321             Yutaka Niibe  <gniibe@chroot.org>
322
323         * sysdeps/sh/pt-machine.h (testandset): Since the operand of TAS.B
324         has restrictions, use register.
325
326 2000-10-23  Andreas Schwab  <schwab@suse.de>
327
328         * Examples/ex14.c (TIMEOUT): Override default timeout.
329
330 2000-10-16  Ulrich Drepper  <drepper@redhat.com>
331
332         * specific.c: Protect tsd array modification in thread data
333         structures by getting the thread lock in pthread_key_delete and
334         __pthread_destroy_specifics.
335         Patch by Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>.
336
337 2000-10-12  Alan Modra <alan@linuxcare.com.au>
338
339         * sysdeps/pthread/bits/initspin.h: New file.
340         * spinlock.h: Move LOCK_INITIALIZER definition to <bits/initspin.h>.
341         (__pthread_init_lock): Initialize lock with LT_SPINLOCK_INIT.
342         (__pthread_alt_init_lock): Likewise.
343         (__pthread_alt_trylock): Release lock with LT_SPINLOCK_INIT.
344
345 2000-10-12  David Huggins-Daines  <dhd@linuxcare.com>
346
347         * oldsemaphore.c (__old_sem_init): Release lock with
348         LT_SPINLOCK_INIT, not zero.
349         * spinlock.c (__pthread_unlock): Likewise.
350         (__pthread_alt_lock): Likewise.
351         (__pthread_alt_timedlock): Likewise.
352         (__pthread_alt_unlock): Likewise.
353         * sysdeps/pthread/bits/libc-lock.h: Initialize locks with
354         LT_SPINLOCK_INIT if it is non-zero.  Likewise for init-once flags.
355         * sysdeps/pthread/pthread.h: Include bits/initspin.h.  Use
356         LT_SPINLOCK_INIT do initialize spinlocks not 0.
357
358 2000-10-12  David Huggins-Daines <dhd@linuxcare.com>
359
360         * shlib-versions: Add version definitions for hppa-linux.
361
362 2000-10-12  Alan Modra <alan@linuxcare.com.au>
363
364         * sysdeps/hppa/pspinlock.c: New file.
365         * sysdeps/hppa/pt-machine.h: New file.
366         * sysdeps/unix/sysv/linux/hppa/bits/initspin.h: New file.
367
368 2000-10-05  Jakub Jelinek  <jakub@redhat.com>
369
370         * mutex.c (__pthread_mutex_destroy): Correct test of
371         busy mutex for mutexes using alternate fastlocks.
372         Patch by dtc@cmucl.cons.org.
373
374 2000-09-28  Martin Schwidefsksy    <schwidefsky@de.ibm.com>
375
376         * sysdeps/s390/pt-machine.h: Make %a0 the thread register.
377
378 2000-09-28  Ulrich Drepper  <drepper@redhat.com>
379
380         * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
381         test for owner first.
382         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
383
384         * cancel.c (pthread_cancel): Don't do anything if cancelation is
385         disabled.
386
387 2000-09-26  Ulrich Drepper  <drepper@redhat.com>
388
389         * spinlock.h (__pthread_set_own_extricate_if): Optimize a bit.
390         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
391
392         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
393         _POSIX_MONOTONIC_CLOCK.
394
395         * spinlock.h (__pthread_set_own_extricate_if): Add back locking
396         and explain why.
397
398 2000-09-20  Andreas Jaeger  <aj@suse.de>
399
400         * pthread.c [!__ASSUME_REALTIME_SIGNALS]: Make inclusion of
401         "testrtsig.h" conditional.
402
403 2000-09-11  Ulrich Drepper  <drepper@redhat.com>
404
405         * sysdeps/pthread/pthread.h: Declare pthread_attr_getstack and
406         pthread_attr_setstack.
407         * Versions [libpthread] (GLIBC_2.2): Export pthread_attr_getstack and
408         pthread_attr_setstack.
409         * attr.c (pthread_attr_getstack, pthread_attr_setstack): New functions.
410
411 2000-09-05  Ulrich Drepper  <drepper@redhat.com>
412
413         * Examples/ex14.c: New file.
414         * Makefile (tests): Add ex14.
415
416         * mutex.c (__pthread_mutex_unlock): Correct test for already unlocked
417         mutex.  Patch by dtc@cmucl.cons.org.
418
419         * ecmutex.c: New file.
420         * Makefile (tests): Add ecmutex.
421
422 2000-09-04  H.J. Lu  <hjl@gnu.org>
423
424         * attr.c (__pthread_attr_setguardsize): Use page_roundup
425         instead of roundup to round up to the page size.
426
427 2000-09-03  Mark Kettenis  <kettenis@gnu.org>
428
429         * manager.c (pthread_exited): Correctly report event as TD_REAP
430         instead of TD_DEATH.  Fix comments.
431
432 2000-09-03  Ulrich Drepper  <drepper@redhat.com>
433
434         * spinlock.h (testandset): Add cast to avoid warning.
435         Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
436
437 2000-09-02  Andreas Jaeger  <aj@suse.de>
438
439         * sysdeps/pthread/timer_routines.c: Include stdlib.h for abort
440         prototype.
441
442 2000-09-01  Ulrich Drepper  <drepper@redhat.com>
443
444         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
445         Fix typo in last patch (_mode -> _flags).
446
447         * sysdeps/pthread/bits/stdio-lock.h (_IO_cleanup_region_start):
448         Provide definition which respects _IO_USER_LOCK flag.
449
450 2000-08-30  Ulrich Drepper  <drepper@redhat.com>
451
452         * manager.c (pthread_allocate_stack): Clear descriptor only if not
453         mmaped.
454
455 2000-08-25  Ulrich Drepper  <drepper@redhat.com>
456
457         * Makefile: Add rules to build and run unload.
458         * unload.c: New file.
459
460         * pthread.c (pthread_exit_process): Move thread_self use inside `if'.
461
462         * sysdeps/pthread/pthread.h
463         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Defined.
464         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: Defined.
465
466 2000-08-24  Andreas Jaeger  <aj@suse.de>
467
468         * Examples/ex13.c: Include <string.h> for strerror prototype and
469         <stdlib.h> for abort prototype.
470         (pthr_cond_signal_mutex): Rewrite to silence GCC.
471         (thread_start): Remove unused variable err.
472         (main): Silence GCC warnings.
473
474 2000-08-22  Andreas Jaeger  <aj@suse.de>
475
476         * Examples/ex13.c: New test by Kurt Garloff <garloff@suse.de>.
477
478         * Makefile (tests): Add ex13.
479
480 2000-08-20  Ulrich Drepper  <drepper@redhat.com>
481
482         * semaphore.h: Add restrict where required by AGd4.
483         * sysdeps/pthread/pthread.h: Likewise.
484         * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
485
486 2000-08-15  Ulrich Drepper  <drepper@redhat.com>
487
488         * Makefile (tests): Add ex12.  Add rule to build it.
489         * Examples/ex12.c: New file.
490
491 2000-08-13  Ulrich Drepper  <drepper@redhat.com>
492
493         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES
494         even though the implementation is not quite complete (but it reports
495         it).  Define _POSIX_MESSAGE_PASSING to -1.
496         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
497
498 2000-08-12  Andreas Jaeger  <aj@suse.de>
499
500         * sysdeps/mips/pt-machine.h (testandset): Add .set mips2 for
501         assembler.
502         (__compare_and_swap): Likewise.
503         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Likewise.
504
505 2000-08-10  Ulrich Drepper  <drepper@redhat.com>
506
507         * pthread.c (__pthread_initial_thread): Initialize p_errnop and
508         p_h_errnop correctly and not to NULL.
509
510 2000-08-05  Ulrich Drepper  <drepper@redhat.com>
511
512         * Banner: Bump version number to 0.9.
513
514 2000-08-04  Ulrich Drepper  <drepper@redhat.com>
515
516         * Makefile (tests): Add tststack.  Add rule to build the program.
517         * tststack.c: New file.
518
519         * internals.h: Declare __pthread_max_stacksize.
520         * pthread.c (__pthread_max_stacksize): New variable.
521         (__pthread_initialize_manager): Determine __pthread_initialize_manager
522         value.
523         * manager.c (thread_segment): Return always NULL if FLOATING_STACKS.
524         (pthread_allocate_stack): Allow kernel to choose stack address if
525         FLOATING_STACKS.  This also handles variable-sized stacks.
526         Always allocate stack and guardpage together.  Use mprotect to
527         change guardpage access.
528         * sysdeps/i386/useldt.h: Define FLOATING_STACKS and
529         ARCH_STACK_MAX_SIZE.
530
531         * attr.c (__pthread_attr_setstacksize): Also test value against
532         upper limit.
533
534         * manager.c (__pthread_nonstandard_stacks): Define only if
535         THREAD_SELF is not defined.
536         (pthread_allocate_stack): Always initialize gardaddr to a correct
537         value.
538         (pthread_handle_create): Unmap thread with one call.
539         (pthread_free): Remove test for initial thread before removing stack.
540         Unmap stack with one call.
541
542         * pthread.c (__pthread_initial_thread): Initialize p_userstack to
543         1 to avoid removing the stack.
544
545 2000-07-27  Jes Sorensen  <jes@linuxcare.com>
546
547         * sysdeps/ia64/pspinlock.c (__pthread_spin_lock): Add
548         load of spin lock to prime the cache before the atomic compare and
549         exchange operation (cmpxchg4). This avoids the spinning on the
550         cmpxchg4 instruction and reduces movement of the cache line back
551         and forth between the processors (explanation by Asis K. Mallick
552         from Intel). This basically makes the implementation operate the
553         same as the Linux kernel implementation.
554
555         * shlib-versions: Use GLIBC_2_2 for Linux/ia64.
556         * sysdeps/ia64/pspinlock.c: New file.
557
558 2000-08-03  Ulrich Drepper  <drepper@redhat.com>
559
560         * pthread.c: Move definition of __pthread_set_own_extricate_if...
561         * spinlock.h: ...here.  Remove locking.
562         * internals.h: Remove __pthread_set_own_extricate_if prototype.
563
564         * rwlock.c: Use THREAD_GETMEM And THREAD_SETMEM.
565         (rwlock_rd_extricate_func): Don't determine self, let
566         __pthread_lock do it.
567         (rwlock_wr_extricate_func): Likewise.
568         (rwlock_have_already): Optimize *pself handling a bit.
569
570         * mutex.c: Use __builtin_expect.
571         * pthread.c: Likewise.
572
573 2000-08-02  Andreas Jaeger  <aj@suse.de>
574
575         * sysdeps/s390/pspinlock.c: New file.
576         * sysdeps/s390/pt-machine.h: New file.
577         Patches by Martin Schwidefsky <schwidefsky@de.ibm.com>.
578
579 2000-07-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
580
581         * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Implement for
582         R3K.
583         * sysdeps/mips/pt-machine.h (testandset): Likewise.
584
585 2000-07-26  Andreas Jaeger  <aj@suse.de>
586
587         * pthread.c: Initialize p_sem_avail.
588
589 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
590
591         * internals.h (struct __pthread_descr_struct): Add p_sem_avail.
592         * semaphore.c: Handle spurious wakeups.
593
594         * sysdeps/pthread/pthread.h: Add back PTHREAD_MUTX_FAST_NP as an alias
595         for PTHREAD_MUTEX_ADAPTIVE_NP for source code compatibility.
596
597         * pthread.c (__pthread_set_own_extricate): Use THREAD_GETMEM.
598         (__pthread_wait_for_restart): Likewise.
599
600         * condvar.c (pthread_cond_wait): Also check whether thread is
601         cancelable before aborting loop.
602         (pthread_cond_timedwait): Likewise.
603
604         * signals.c (pthread_sighandler): Remove special code to restrore
605         %gs on x86.
606         (pthread_sighandler_t): Likewise.
607
608 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
609
610         * internals.h (__RES_PTHREAD_INTERNAL): Remove define.
611         * pthread.c: Include <resolv.h>.
612         (_res): Undefine.  Add extern declaration.
613
614 2000-07-24  Ulrich Drepper  <drepper@redhat.com>
615
616         * pthread.c (__pthread_initial_thread): Update initializer.
617         (__pthread_manager_thread): Likewise.
618         (pthread_initialize): Move setrlimit call to...
619         (__pthread_initialize_manager): ...here.
620         (__pthread_reset_main_thread): Reset also soft limit on stack size.
621
622         * condvar.c: Handle spurious wakeups.  [PR libc/1749].
623         * internals.h (struct _pthread_descr_struct): Add p_condvar_avail.
624
625 2000-07-21  Ulrich Drepper  <drepper@redhat.com>
626
627         * spinlock.h: If IMPLEMENT_TAS_WITH_CAS is defined use
628         __compare_and_swap to define testandset.
629         * sysdeps/powerpc/pt-machine.h: Add volatile to asms.
630         Define IMPLEMENT_TAS_WITH_CAS.
631
632 2000-07-20  Ulrich Drepper  <drepper@redhat.com>
633
634         * Makefile: Pass -z nodelete to linker for libpthread.so
635         generation if it understand this option.
636
637 2000-07-18  Mark Kettenis  <kettenis@gnu.org>
638
639         * manager.c (pthread_handle_create): Remove initialization of
640         new_thread->p_res._sock.
641
642 2000-07-19  Kaz Kylheku  <kaz@ashi.footprints.net>
643
644         Bugfixes to the variant of the code for machines with no compare
645         and swap.
646
647         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Wait
648         node was not being properly enqueued, due to failing to update
649         the lock->__status field.
650
651         * spinlock.c (__pthread_alt_timedlock): The oldstatus variable was
652         being set inappropriately, causing the suspend function to be called
653         with a null self pointer and crash.
654
655 2000-07-18  Ulrich Drepper  <drepper@redhat.com>
656
657         * spinlock.h (__pthread_alt_trylock): Fix code used if no
658         compare&swap is available.
659
660         * spinlock.h (__pthread_trylock): Use __compare_and_swap, not
661         compare_and_swap.
662
663         * pthread.c (pthread_initialize): Don't use sysconf to determine
664         whether the machine has more than one processor.
665
666         * spinlock.c (__pthread_alt_timedlock): Add back one of the
667         removed thread_self calls.
668
669 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
670
671         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Changed
672         __compare_and_swap to compare_and_swap in code which assumes
673         compare swap is available.
674
675 2000-07-18  Kaz Kylheku  <kaz@ashi.footprints.net>
676
677         * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
678         bug whereby thr field of waitnode structure would not be correctly
679         set unless a null self pointer is passed to the functions.
680         Eliminated redundant calls to thread_self().
681
682 2000-07-18  Jakub Jelinek  <jakub@redhat.com>
683
684         * pthread.c (__pthread_initialize_manager): Lock
685         __pthread_manager_thread.p_lock before calling clone.
686
687 2000-05-05  H.J. Lu  <hjl@gnu.org>
688
689         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
690         have acquire semantics.
691         (__compare_and_swap_with_release_semantics): New inline
692         function.
693         (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.
694
695 2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>
696
697         * manager.c: Fix the problem with signals at startup.
698         Change the way that thread stacks are allocated on IA64.
699         Clean up some of the guard page allocation stuff.
700
701 1999-12-19  H.J. Lu  <hjl@gnu.org>
702
703         * internals.h (page_roundup): New.
704         * attr.c (__pthread_attr_setguardsize); Use page_roundup
705         instead of roundup.
706         * manager.c (pthread_allocate_stack): Make sure guardaddr is
707         page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
708         is define.
709
710 1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>
711
712         * manager.c (pthread_allocate_stack): Unmap the stack top
713         if failed to map the stack bottom.
714         Fix the guard page.
715         (pthread_free): Fix the guard page.
716
717         * pthread.c (pthread_initialize): Set rlimit correctly for
718         NEED_SEPARATE_REGISTER_STACK.
719
720 1999-12-16  H.J. Lu  <hjl@gnu.org>
721
722         * pthread.c (__pthread_initialize_manager): Pass
723         __pthread_manager_thread_bos instead of
724         __pthread_manager_thread_tos to __clone2.
725
726 1999-12-16  H.J. Lu  <hjl@gnu.org>
727
728         * manager.c (pthread_allocate_stack): Correct the calculation
729         of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
730         stack bottom.
731
732 1999-12-13  H.J. Lu  <hjl@gnu.org>
733
734         * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
735         bit after setting ar.ccv.
736
737 1999-12-12  H.J. Lu  <hjl@gnu.org>
738
739         * manager.c (pthread_allocate_stack): Make the starting
740         address of the stack bottom page aligned. FIXME: it may
741         need changes in other places.
742         (pthread_handle_create): Likewise.
743
744 1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>
745
746         * manager.c (pthread_allocate_stack): Handle
747         NEED_SEPARATE_REGISTER_STACK.
748         (pthread_handle_create): Likewise.
749         * pthread.c (__pthread_initialize_manager): Likewise.
750
751         * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.
752
753 1999-12-02  H.J. Lu  <hjl@gnu.org>
754
755         * sysdeps/ia64/pt-machine.h: New.
756
757 2000-07-13  Ulrich Drepper  <drepper@redhat.com>
758
759         * wrapsyscall.c: Mark non-__ protected names as weak.
760         PR libc/1466.
761
762 2000-07-12  Bruno Haible  <haible@clisp.cons.org>
763
764         * Examples/ex8.c: Include <sys/wait.h>, not <wait.h>.
765
766 2000-07-12  Ulrich Drepper  <drepper@redhat.com>
767
768         * spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
769         Add tests also to new alternative spinlock implementation.
770         * spinlock.h: Likewise.
771         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
772
773 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
774
775         * Version: Export __sigaction.
776         * signals.c: Define __sigaction alias.  Use __libc_sigaction instead
777         of __sigaction.
778         * pthread.c: Use __libc_sigaction instead of __sigaction.
779
780         * condvar.c: Implement pthread_condattr_getpshared and
781         pthread_condattr_setpshared.
782         * mutex.c: Implement pthread_mutexattr_getpshared and
783          pthread_mutexattr_setpshared.
784         * Versions: Export new functions.
785         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
786
787         * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
788         (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
789         is not selected.
790
791 2000-07-04  Greg McGary  <greg@mcgary.org>
792
793         * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
794         pragmas.  Include bp-sym.h only if _LIBC.
795
796 2000-07-04  Ulrich Drepper  <drepper@redhat.com>
797
798         * spinlock.c (__pthread_unlock): Properly place write barrier.
799         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
800
801 2000-07-03  Ulrich Drepper  <drepper@redhat.com>
802
803         * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are
804         faster on SMP systems.  No more emulation of compare&swap for adaptive
805         spinlocks.
806         * spinlock.h: Likewise.
807         * sysdeps/pthread/pthread.h: Shuffle PTHREAD_MUTEX_* values around.
808         Replace fast with adaptive mutex.
809         * mutex.c: Rewrite for replacement of fast by adaptive mutex.
810         * condvar.c: Likewise.
811         * pthread.c: Define and initialize __pthread_smp_kernel variable.
812         * internals.h: Declare __pthread_smp_kernel.
813         * sysdeps/pthread/bits/pthreadtypes.h: Update comment of
814         _pthread_fastlock structure.
815         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
816
817         * pthread.c: Remove initialization to zero from global variables.
818
819 2000-06-29  Jakub Jelinek  <jakub@redhat.com>
820
821         * shlib-versions: Make sparc64 GLIBC_2.2+ only.
822
823 2000-06-28  Greg McGary  <greg@mcgary.org>
824
825         * weaks.c: Wrap BP_SYM () around weak extern declarations of
826         pthread functions that have pointers in their return+arg signatures.
827
828 2000-06-27  Greg McGary  <greg@mcgary.org>
829
830         * sysdeps/pthread/bits/libc-lock.h: Wrap BP_SYM () around weak
831         extern declarations of pthread functions that have pointers in
832         their return+arg signatures.
833
834 2000-06-26  Ulrich Drepper  <drepper@redhat.com>
835
836         * Makefile (tests): Add ex11.  Add rules to build it.
837         * Examples/ex11.c: New file.
838         * rwlock.c: Fix complete braindamaged previous try to implement
839         timedout functions.
840
841         * spinlock.c: Pretty print.
842
843 2000-06-25  Ulrich Drepper  <drepper@redhat.com>
844
845         * Makefile (tests): Add ex10.  Add rules to build it.
846         * Versions [GLIBC_2.2] (libpthread): Add pthread_mutex_timedlock,
847         pthread_rwlock_timedrdlock, and pthread_rwlock_timedwrlock.
848         * condvar.c (pthread_cond_wait): Allow mutex of kind
849         PTHREAD_MUTEX_TIMED_NP.
850         (pthread_cond_timedwait_relative): Likewise.
851         * mutex.c (__pthread_mutex_init): Default is PTHREAD_MUTEX_TIMED_NP.
852         (__pthread_mutex_trylock): Use __pthread_alt_trylock for
853         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
854         (__pthread_mutex_lock): Use __pthread_alt_lock for
855         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
856         (__pthread_mutex_timedlock): New function.
857         (__pthread_mutex_unlock): Use __pthread_alt_unlock for
858         PTHREAD_MUTEX_ERRORCHECK_NP.  Handle PTHREAD_MUTEX_TIMED_NP.
859         (__pthread_mutexattr_init): Use PTHREAD_MUTEX_TIMED_NP.
860         (__pthread_mutexattr_settype): Allow PTHREAD_MUTEX_TIMED_NP.
861         * spinlock.c: Implement alternate fastlocks.
862         * spinlock.h: Add prototypes.
863         * Examples/ex10.c: New file.
864         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
865         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
866
867         * rwlock.c (__pthread_rwlock_rdlock): Optimize loop a bit.
868         (__pthread_rwlock_timedrdlock): New function.
869         (__pthread_rwlock_timedwrlock): New function.
870         Use laternate fastlock function everywhere.
871
872 2000-06-21  Andreas Jaeger  <aj@suse.de>
873
874         * sysdeps/pthread/timer_routines.c: Include <string.h> for memset
875         prototype.
876
877         * join.c: Include <stdlib.h> for exit prototype.
878
879 2000-06-20  Ulrich Drepper  <drepper@redhat.com>
880
881         * sysdeps/i386/useldt.h: Include <stdlib.h>.
882
883         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_BARRIERS.
884         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
885
886         * Makefile (libpthread-routines): Add barrier.
887         (tests): Add ex9.  Add rule to build ex9.
888         * Versions: Export barrier functions.
889         * barrier.c: New file.
890         * Examples/ex9.c: New file.
891         * sysdeps/pthread/pthread.h: Add barrier data types and declarations.
892         * sysdeps/pthread/bits/pthreadtypes.h: Likewise.
893         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
894
895 2000-06-19  H.J. Lu  <hjl@gnu.org>
896
897         * spinlock.h (HAS_COMPARE_AND_SWAP): Defined if
898         HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS is defined.
899         (compare_and_swap_with_release_semantics): New. Default to
900         compare_and_swap if HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
901         is not defined.
902
903         * spinlock.c (__pthread_unlock): Call
904         compare_and_swap_with_release_semantics () instead of
905         compare_and_swap ().
906
907 2000-06-19  Ulrich Drepper  <drepper@redhat.com>
908
909         * sysdeps/pthread/timer_create.c: Use _set_errno instead of assigning
910         to errno directly.
911         * sysdeps/pthread/timer_delete.c: Likewise.
912         * sysdeps/pthread/timer_getoverr.c: Likewise.
913         * sysdeps/pthread/timer_gettime.c: Likewise.
914         * sysdeps/pthread/timer_settime.c: Likewise.
915
916 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
917
918         Timer nodes are now reference counted, and can be marked
919         as deleted. This allows for the safe release of the global mutex
920         in the middle without losing the timer being operated on.
921
922         * sysdeps/pthread/posix-timer.h (struct timer_node):  The inuse
923         member is now an enum with three values, so that an intermediate
924         state can be represented (deleted but not free for reuse yet).
925         New refcount member added.
926         * sysdeps/pthread/timer_routines.c: Likewise.
927
928         * sysdeps/pthread/posix-timer.h (timer_addref, timer_delref,
929         timer_valid): New inline functions added.
930
931         * sysdeps/pthread/timer_gettime.c (timer_gettime): Function
932         restructured, recursive deadlock bug fixed.
933
934         * sysdeps/pthread/timer_gettime.c (timer_gettime): Uses new
935         timer_addref to ensure that timer won't be deleted while mutex is not
936         held. Also uses timer_invalid to perform validation of timer handle.
937         * sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
938         * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
939
940 2000-06-14  Ulrich Drepper  <drepper@redhat.com>
941
942         * shlib-versions: Add entry for SH.
943         Patch by Kaz Kojima <kkojima@rr.iij4u.or.jp>.
944
945 2000-06-13  Kaz Kylheku  <kaz@ashi.footprints.net>
946
947         A few optimizations.  Got rid of unnecessary wakeups of timer threads,
948         tightened up some critical regions and micro-optimized some list
949         manipulation code.
950
951         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
952         Returns int value now to indicate whether timer was queued at head.
953         * sysdeps/pthread/posix-timer.h: Likewise.
954         * sysdeps/pthread/timer_settime.c (timer_settime): Takes advantage of
955         new return value from __timer_thread_queue_timer to avoid waking
956         up timer thread unnecessarily.
957
958         * sysdeps/pthread/posix-timer.h (timer_id2ptr): No longer checks
959         inuse flag, because this requires mutex to be held.  Callers updated
960         to do the check when they have the mutex.
961         * sysdeps/pthread/timer_getoverr.c: Add check for inuse here.
962
963         * sysdeps/pthread/timer_settime.c (timer_settime): Tighter critical
964         regions: avoids making system calls while holding timer mutex, and
965         a few computations were moved outside of the mutex as well.
966         * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
967
968         * sysdeps/pthread/posix-timer.h (list_unlink_ip): Function name changed
969         to list_unlink_ip, meaning idempotent.  Pointer manipulation
970         changed to get better better code out of gcc.
971         * sysdeps/pthread/timer_routines.c (list_unlink): Non-idempotent
972         version of list_unlink added here.
973         * sysdeps/pthread/timer_delete.c: Use appropriate list unlink
974         function in all places: idempotent one for timers, non-idempotent
975         one for thread nodes.
976         * sysdeps/pthread/timer_settime: Likewise.
977         * sysdeps/pthread/timer_routines.c: Likewise.
978
979 2000-06-13  Ulrich Drepper  <drepper@redhat.com>
980
981         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_TIMERS): Define.
982         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
983
984         * sysdeps/pthread/Makefile: Remove tests definition.
985
986 2000-06-12  Kazumoto Kojima  <kkojima@rr.iij4u.or.jp>
987             Yutaka Niibe  <gniibe@chroot.org>
988
989         * sysdeps/sh/pspinlock.c: New file.
990         * sysdeps/sh/pt-machine.h: New file.
991
992 2000-06-12  Ulrich Drepper  <drepper@redhat.com>
993
994         * Makefile (tests): Add joinrace.
995
996         * Examples/ex6.c: Test return value of pthread_join.
997
998 2000-06-11  Geoff Keating  <geoffk@cygnus.com>
999
1000         * sysdeps/powerpc/pspinlock.c (__pthread_spin_lock): Implement.
1001         (__pthread_spin_trylock): Implement.
1002         (__pthread_spin_unlock): Implement.
1003         (__pthread_spin_init): Implement.
1004         (__pthread_spin_destroy): Implement.
1005
1006 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
1007
1008         * sysdeps/pthread/timer_routines.c (list_append): Little fix to
1009         really append the entry.
1010
1011 2000-06-10  Andreas Jaeger  <aj@suse.de>
1012
1013         * lockfile.c (__fresetlockfiles): Remove unused variable fp.
1014
1015 2000-06-10  Kaz Kylheku  <kaz@ashi.footprints.net>
1016
1017         * sysdeps/pthread/timer_create.c: Thread matching now done on
1018         clock type as well as thread attributes.
1019         There are individual global signal-delivering threads for
1020         different clock types.
1021         * sysdeps/pthread/posix-timer.h: Likewise.
1022         * sysdeps/pthread/timer_routines.c: Likewise.
1023
1024         * sysdeps/pthread/timer_routines.c: Thread allocation and
1025         deallocation function now remembers to put thread on active
1026         list and remove from active list.
1027         Thus now the feature of binding multiple timers
1028         to a single thread actually works.
1029
1030 2000-06-10  Ulrich Drepper  <drepper@redhat.com>
1031
1032         * pthread.c (__pthread_create_2_1): Optimize a bit.
1033
1034         * internals.h (invalid_handle): Also test for p_terminated != 0.
1035         (nonexisting_handle): New function.  Same as old invalid_handle.
1036         * join.c (pthread_join): Use nonexisting_handle instead of
1037         invalid_handle to test for acceptable thread handle.
1038         * manager.c (pthread_handle_free): Likewise.
1039         * joinrace.c: New file.
1040         Reported by Permaine Cheung <pcheung@cygnus.com>.
1041
1042 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
1043
1044         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1045         Correct handling of matching variable.
1046
1047         * sysdeps/pthread/tst-timer.c (main): Rewrite initializers to
1048         avoid warnings.
1049
1050         * sysdeps/pthread/timer_routines.c (__timer_thread_queue_timer):
1051         Be prepared for empty timer list.
1052
1053         * sysdeps/pthread/timer_create.c (timer_create): Correct names of
1054         CPUTIME clock ID.  Add support for thread clocks.
1055
1056         * sysdeps/pthread/posix-timer.h (timer_ptr2id): Operands in
1057         subtraction were switched.
1058
1059         * sysdeps/pthread/timer_routines.c (init_module): Use
1060         THREAD_MAXNODES threads.
1061
1062         * sysdeps/pthread/posix-timer.h (struct timer_node): Add creator_pid.
1063         * sysdeps/pthread/timer_create.c: Fill in creator_pid.
1064         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Send signal
1065         with sigqueueinfo is this system call is available.
1066
1067         * sysdeps/pthread/timer_create.c (timer_create): Allow
1068         CLOCK_CPUTIME if _POSIX_CPUTIME is defined.
1069
1070         * sysdeps/pthread/Makefile: New file.  Add rules to build timer
1071         functionality.
1072         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add TIMER_MAX.
1073
1074 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
1075
1076         * sysdeps/pthread/posix-timer.h: New file.
1077         * sysdeps/pthread/timer_create.c: New file.
1078         * sysdeps/pthread/timer_delete.c: New file.
1079         * sysdeps/pthread/timer_getoverr.c: New file.
1080         * sysdeps/pthread/timer_gettime.c: New file.
1081         * sysdeps/pthread/timer_routines.c: New file.
1082         * sysdeps/pthread/timer_settime.c: New file.
1083         * sysdeps/pthread/tst-timer.c: New file.
1084
1085 2000-06-08  Ulrich Drepper  <drepper@redhat.com>
1086
1087         * sysdeps/unix/sysv/linux/bits/local_lim.h: Remove OPEN_MAX and
1088         LINK_MAX definitions if necessary.
1089
1090 2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
1091
1092         Added missing fork time handling of global libio lock.
1093
1094         * lockfile.c (__fresetlockfiles): Now also resets the list lock,
1095         not just the individual stream locks. Rewritten to use new
1096         iterator interface provided by libio rather than accessing
1097         global variable.
1098
1099         * lockfile.c (__flockfilelist, _funlockfilelist): New functions
1100         which lock and unlock the stream list using the new interface
1101         provied by libio.
1102         * internals.h: Likewise.
1103
1104         * ptfork.c (__fork): Now calls __flockfilelist before fork,
1105         and __funlockfilelist in the parent after the fork.
1106         Child still calls __fresetlockfiles as before.
1107
1108         * linuxthreads.texi: Now explains what happens to streams at
1109         fork time. Also whole new section on forking and thread added.
1110         Definition of pthread_atfork moved out of Miscellaneous Functions
1111         to this new section.
1112
1113 2000-06-04  Jakub Jelinek  <jakub@redhat.com>
1114
1115         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c (__pthread_spin_lock):
1116         Add missing register.
1117         * sysdeps/sparc/sparc64/pspinlock.c (__pthread_spin_lock): Likewise.
1118
1119 2000-06-02  Jakub Jelinek  <jakub@redhat.com>
1120
1121         * sysdeps/sparc/sparc32/pspinlock.c: Implement spinlocks.
1122         * sysdeps/sparc/sparc32/sparcv9/pspinlock.c: New.
1123         * sysdeps/sparc/sparc64/pspinlock.c: Implement spinlocks.
1124
1125 2000-05-31  Andreas Jaeger  <aj@suse.de>
1126
1127         * sysdeps/mips/pspinlock.c: Implement spinlocks.
1128
1129 2000-05-28  Ulrich Drepper  <drepper@redhat.com>
1130
1131         * spinlock.c (__pthread_lock): Remove ASSERT.
1132
1133         * Makefile (tests): Add ex8.
1134         * Examples/ex8.c: New file.
1135
1136 2000-05-12  Kaz Kylheku  <kaz@ashi.footprints.net>
1137
1138         Bugfix: The pthread_atfork mechanism now takes care of its
1139         own internal mutex at fork time.
1140
1141         * ptfork.c (__fork): Revised so that the mutex is held across
1142         the fork operation and while the handlers are called, and so that
1143         the child resets the mutex.
1144
1145         * linuxthreads.texi: Updated pthread_atfork documentation to make
1146         it clear that fork and pthread_atfork can't be reentered from
1147         atfork handlers, that pthread_atfork and fork are mutually atomic,
1148         and that the handlers are inherited by the child process.
1149
1150 2000-05-24  Ulrich Drepper  <drepper@redhat.com>
1151
1152         * Makefile (libpthread-routines): Add pspinlock.
1153         * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
1154         Use struct _pthread_fastlock instead of pthread_spinlock_t.
1155         * condvar.c: Likewise.
1156         * internals.h: Likewise.
1157         * join.c: Likewise.
1158         * manager.c: Likewise.
1159         * mutex.c: Likewise.
1160         * pthread.c: Likewise.
1161         * rwlock.c: Likewise.
1162         * semaphore.c: Likewise.
1163         * signals.c: Likewise.
1164         * spinlock.h: Likewise.
1165         * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
1166         * sysdeps/alpha/pspinlock.c: New file.
1167         * sysdeps/arm/pspinlock.c: New file.
1168         * sysdeps/i386/pspinlock.c: New file.
1169         * sysdeps/m68k/pspinlock.c: New file.
1170         * sysdeps/mips/pspinlock.c: New file.
1171         * sysdeps/powerpc/pspinlock.c: New file.
1172         * sysdeps/sparc/sparc32/pspinlock.c: New file.
1173         * sysdeps/sparc/sparc64/pspinlock.c: New file.
1174         * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
1175         back to _pthread_fastlock.  Define new pthread_spinlock_t.
1176
1177 2000-05-24  Andreas Jaeger  <aj@suse.de>
1178
1179         * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
1180
1181 2000-05-21  Jakub Jelinek  <jakub@redhat.com>
1182
1183         * manager.c (pthread_handle_create): Initialize p_res._sock to -1.
1184
1185 2000-05-13  Jakub Jelinek  <jakub@redhat.com>
1186
1187         * internals.h (__RES_PTHREAD_INTERNAL): Define.
1188
1189 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
1190
1191         * mutex.c (pthread_once): IN_PROGRESS state of pthread_once_t
1192         object state is represented with additional bits which distinguish
1193         whether that state was set up in the current process, or
1194         in an ancestor process. If that state was set in an ancestor,
1195         it means that a fork happened while thread was executing the init
1196         function. In that case, the state is reset to NEVER.
1197         * mutex.c (__pthread_once_fork_prepare): New function.
1198         (__pthread_once_fork_child): Likewise
1199         (__pthread_once_fork_parent): Likewise
1200         (__pthread_reset_pthread_once): Removed.
1201         * ptfork.c (__fork): Call new handlers in mutex.c.
1202         * internals.h: Declarations of new mutex.c functions added.
1203         Declaration of removed function deleted.
1204         * linuxthreads.texi: Updated documentation about pthread_once
1205         to clarify what happens under cancellation and forking.
1206
1207 2000-05-06  Kaz Kylheku  <kaz@ashi.footprints.net>
1208
1209         * internals.h: New thread manager request type, REQ_KICK.
1210         * join.c (pthread_exit): main thread now calls exit() instead
1211         of _exit() in order to proper process cleanup.
1212         * manager.c (__pthread_manager): Do not terminate manager
1213         after unblocking main thread; wait for main thread's
1214         REQ_PROCESS_EXIT request instead.
1215         Also, added REQ_KICK case to handle new request; this just does
1216         nothing.
1217         * manager.c (pthread_exited): Do not terminate manager after
1218         unblocking main thread.
1219         * manager.c (__pthread_manager_sighandler): If the main thread
1220         is waiting for all other threads to die, send a REQ_KICK into
1221         the thread manager request pipe to get it to clean out the threads
1222         and unblock the main thread as soon as possible. This fixes
1223         the 2000 millisecond hang on shutdown bug.
1224         * Examples/ex7.c: New file, tests shutdown behavior when all threads
1225         including the main one call pthread_exit(), or implicitly do so.
1226         * Makefile (tests): Add ex7.
1227
1228 2000-05-05  Andreas Jaeger  <aj@suse.de>
1229
1230         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1231         (pthread_getcpuclockid): Correct test for ourselves.
1232
1233 2000-05-05  Ulrich Drepper  <drepper@redhat.com>
1234
1235         * internals.h (struct _pthread_descr_struct): Reorganization.
1236         Allocate room for 16 pointers at head of the structure for future
1237         thread-local data handling.  Move p_self member in this area.
1238         * manager.c (pthread_handle_create): Adjust use of p_self.
1239         * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
1240         * pthread.c (__pthread_initial_thread): Adjust initialization.
1241         (__pthread_manager_thread): Likewise.
1242
1243 2000-04-29  Bruno Haible  <haible@clisp.cons.org>
1244
1245         * join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
1246         for eventmask larger than 1 word.
1247
1248 2000-04-27  Ulrich Drepper  <drepper@redhat.com>
1249
1250         * Versions [libpthread] (GLIBC_2.2): Add __pthread_initialize_minimal.
1251         * pthread.c (__pthread_initialize_minimal): New function.  Perform
1252         minimal initialization.
1253         (pthread_initialize): Remove this code here.
1254         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h" again.  We
1255         are working around the problem in glibc.
1256
1257 2000-04-25  Ulrich Drepper  <drepper@redhat.com>
1258
1259         * sysdeps/i386/i686/pt-machine.h: Do not use "../useldt.h" for
1260         now.  First gcc must be fixed (more concrete: libgcc).
1261
1262 2000-04-24  Ulrich Drepper  <drepper@redhat.com>
1263
1264         * pthread.c: Remove special treatement for interrupt handlers on x86.
1265         * manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
1266         * sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
1267         necessary.
1268         * sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
1269
1270 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
1271
1272         * join.c (pthread_exit): Set p_terminated after reporting the
1273         termination event instead of before.
1274
1275 2000-04-20  Jakub Jelinek  <jakub@redhat.com>
1276
1277         * sysdeps/pthread/bits/libc-lock.h: Only declare __pthread_rwlock_*
1278         if __USE_UNIX98.
1279
1280 2000-04-18  Andreas Jaeger  <aj@suse.de>
1281
1282         * Versions: Use ld instead of ld.so.
1283
1284 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
1285
1286         * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h (struct sigcontext):
1287         Remove the typedef keyword.
1288
1289 2000-04-18  Jakub Jelinek  <jakub@redhat.com>
1290
1291         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Use membar,
1292         not stbar.
1293         (READ_MEMORY_BARRIER): Define.
1294         * spinlock.c (__pthread_spin_unlock): Use READ_MEMORY_BARRIER, not
1295         MEMORY_BARRIER.
1296         * internals.h (READ_MEMORY_BARRIER): Define if not defined in sysdep
1297         headers.
1298
1299 2000-04-17  Ulrich Drepper  <drepper@redhat.com>
1300
1301         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1302         (pthread_getcpuclockid): Don't compare thread_id with thread_self,
1303         use thread_handle().
1304
1305 2000-04-16  Ulrich Drepper  <drepper@redhat.com>
1306
1307         * condvar.c (pthread_cond_timedwait_relative): Don't test for owner
1308         if fast mutex is used.  Don't initialize `already_canceled' twice.
1309         Correctly test for return value of timedsuspend.
1310
1311         * pthread.c: Correct long-time braino.  We never set SA_SIGINFO and
1312         therefore don't need the _rt versions of the signal handlers.
1313
1314 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
1315
1316         * pthread.c (pthread_yield): New function.
1317         * sysdeps/pthread/pthread.h (pthread_yield): Add prototype.
1318         * Versions [libpthread] (GLIBC_2.2): Add pthread_yield.
1319         * internals.h: Declare __pthread_yield.
1320
1321         * pthread.c (pthread_initialize): Avoid a bit more code if
1322         realtime signals are known to exist.
1323
1324         * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
1325         to dynamically detect RT signals and avoid generating compatibility
1326         functions with old kernel.
1327         * restart.h (restart) [__ASSUME_REALTIME_SIGNALS]: Use
1328         __pthread_restart_new directly.
1329         (suspend) [__ASSUME_REALTIME_SIGNALS]: Use
1330         __pthread_wait_for_restart_signal directly.
1331         (timedsuspend) [__ASSUME_REALTIME_SIGNALS]: Use
1332         __pthread_timedsuspend_new directly.
1333
1334 2000-04-15  Ulrich Drepper  <drepper@redhat.com>
1335
1336         * condvar.c: Remove all the special code to handle cond_timedwait.
1337         Use timedsuspend instead.
1338         * internals.h: Declare __pthread_timedsuspend_old,
1339         __pthread_timedsuspend_new, and __pthread_timedsuspend.
1340         Remove declaration of __pthread_init_condvar.
1341         * pthread.c: Define __pthread_timedsuspend variable.
1342         (__pthread_timedsuspend_old): New function.  Timed suspension
1343         implementation for old Linux kernels.
1344         (__pthread_timedsuspend_new): New function.  Timed suspension
1345         implementation for new Linux kernels.
1346         * restart.h (timedsuspend): New function.  Call appropriate
1347         suspension function through __pthread_timedsuspend.
1348         * semaphore.c (sem_timedwait): Use timedsuspend, don't duplicate
1349         the code.
1350         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1351
1352         * internals.h (WRITE_MEMORY_BARRIER): Define as MEMORY_BARRIER if
1353         undefined.
1354         * spinlock.c: Use WRITE_MEMORY_BARRIER instead of MEMORY_BARRIER
1355         where possible.
1356         * sysdeps/alpha/pt-machine.h: Define WRITE_MEMORY_BARRIER.
1357         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
1358
1359         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _POSIX_SPAWN.
1360         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1361
1362 2000-04-14  Andreas Jaeger  <aj@suse.de>
1363
1364         * weaks.c: Fix typo.
1365
1366         * shlib-versions (mips.*-.*-linux.*): Support only GLIBC 2.0 and
1367         2.2 for linuxthreads.
1368
1369 2000-04-13  Ulrich Drepper  <drepper@redhat.com>
1370
1371         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c
1372         (pthread_getcpuclockid): Fix typo.
1373
1374 2000-04-12  Ulrich Drepper  <drepper@redhat.com>
1375
1376         * Makefile (libpthread-routines): Add getcpuclockid.
1377         * Versions [libpthread] (GLIBC_2.2): Add pthread_getcpuclockid.
1378         * sysdeps/pthread/getcpuclockid.c: New file.
1379         * sysdeps/unix/sysv/linux/i386/getcpuclockid.c: New file.
1380         * sysdeps/pthread/pthread.h: Add prototype for pthread_getcpuclockid.
1381
1382         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_SPIN_LOCKS):
1383         Defined.
1384         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1385
1386         * sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
1387         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1388         and pthread_spin_unlock.
1389         * sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
1390         into pthread_spinlock_t.  Change all uses.
1391         * spinlock.c: Implement pthread_spin_lock.
1392         Rename __pthread_unlock to __pthread_spin_unlock and define weak
1393         alias for real name.
1394         Define pthread_spin_trylock, pthread_spin_init, and
1395         pthread_spin_destroy.
1396         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1397         * spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
1398         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1399         * Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
1400         pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
1401         and pthread_spin_unlock.
1402         * cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
1403         Change all uses of _pthread_fastlock to pthread_spinlock_t.
1404         * condvar.c: Likewise.
1405         * internals.h: Likewise.
1406         * join.c: Likewise.
1407         * manager.c: Likewise.
1408         * mutex.c: Likewise.
1409         * pthread.c: Likewise.
1410         * rwlock.c: Likewise.
1411         * semaphore.c: Likewise.
1412         * signals.c: Likewise.
1413
1414         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add various new POSIX
1415         macros.
1416         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1417
1418 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
1419
1420         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add
1421         _POSIX_SHARED_MEMORY_OBJECTS.
1422
1423 2000-04-11  Andreas Jaeger  <aj@suse.de>
1424
1425         * sysdeps/mips/pt-machine.h (MEMORY_BARRIER): Define.
1426         (__compare_and_swap): Mark as modifying memory.
1427
1428 2000-04-11  Geoff Keating  <geoffk@cygnus.com>
1429
1430         * sysdeps/powerpc/pt-machine.h (MEMORY_BARRIER): Don't be
1431         __volatile__.
1432         (__compare_and_swap): Replace other 'sync' with MEMORY_BARRIER.
1433         Don't have the 'asm' __volatile__.
1434
1435 2000-04-11  Ulrich Drepper  <drepper@redhat.com>
1436
1437         * internals.h: Define MEMORY_BARRIER as empty if not defined already.
1438         * spinlock.c (__pthread_lock): Add memory barriers.
1439         (__pthread_unlock): Likewise.
1440         * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
1441         instruction.
1442         (RELEASE): Not needed anymore.
1443         (__compare_and_swap): Mark asm as modifying memory.
1444         * sysdeps/powerpc/pt-machine.h (sync): Remove.  Replace with definition
1445         of MEMORY_BARRIER.
1446         (__compare_and_swap): Use MEMORY_BARRIER instead of sync.
1447         * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
1448         (MEMORY_BARRIER): Define using stbar.
1449         * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
1450         stbar.
1451         (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
1452         Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
1453         Mike Burrows <m3b@pa.dec.com>.
1454
1455 2000-04-09  Ulrich Drepper  <drepper@redhat.com>
1456
1457         * signals.c (sigaction): Fix return value for the case SIG is one
1458         of the signals the implementation uses.
1459         Patch by Xavier.Leroy@inria.fr.
1460
1461 2000-04-01  Andreas Jaeger  <aj@suse.de>
1462
1463         * attr.c: Use shlib-compat macros.
1464         * oldsemaphore.c: Likewise.
1465         * pthread.c: Likewise.
1466         * weaks.c: Likewise.
1467
1468 2000-03-26  Ulrich Drepper  <drepper@redhat.com>
1469
1470         * semaphore.c (sem_timedwait): New function.
1471         Patch by Carl Mailloux <carlm@oricom.ca>.
1472         * semaphore.h: Declare sem_timedwait.
1473         * Versions [libpthread] (GLIBC_2.2): Add sem_timedwait.
1474
1475 2000-03-26  Roland McGrath  <roland@baalperazim.frob.com>
1476
1477         * sysdeps/pthread/Makefile: File removed.
1478
1479 2000-03-23  Ulrich Drepper  <drepper@redhat.com>
1480
1481         * mutex.c (__pthread_reset_pthread_once): Reset once_masterlock.
1482         * internals.h (__pthread_reset_pthread_once): Add prototype.
1483         * ptfork.c (__fork): Call __pthread_reset_pthread_once.
1484
1485         * manager.c (pthread_handle_create): Store ID of new thread before
1486         clone call.
1487
1488 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
1489
1490         * attr.c: Use new macros from shlib-compat.h to define versions.
1491         * oldsemaphore.c: Likewise.
1492         * semaphore.c: Likewise.
1493         * weaks.c: Likewise.
1494
1495         * pthread.c: Update for new SHLIB_COMPAT definition.
1496
1497         * manager.c (__pthread_manager): Unmask debug signal.
1498
1499         * pthread.c (pthread_initialize): Test for address of __dso_handle
1500         being NULL, not value.  Use __on_exit, not on_exit.
1501         Patch by Andreas Jaeger <aj@suse.de>.
1502
1503         * pthread.c: Use new macros from shlib-compat.h to define versions.
1504
1505 2000-03-19  Ulrich Drepper  <drepper@redhat.com>
1506
1507         * pthread.c (pthread_initialize): Instead of on_exit use
1508         __cxa_atexit if __dso_label is available to allow unloading the
1509         libpthread shared library.
1510
1511 2000-03-16  Ulrich Drepper  <drepper@redhat.com>
1512
1513         * condvar.c: Make tests for ownership of mutex less strict.
1514
1515 2000-03-14  Ulrich Drepper  <drepper@redhat.com>
1516
1517         * condvar.c (pthread_cond_wait): Check whether mutex is owned by
1518         current thread and return error if not.
1519         (pthread_cond_timedwait_relative_old): Likewise.
1520         (pthread_cond_timedwait_relative_new): Likewise.
1521
1522         * mutex.c (__pthread_once): Handle cancelled init function correctly.
1523         (pthread_once_cancelhandler): New function.
1524         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1525
1526 2000-03-14  Andreas Jaeger  <aj@suse.de>
1527
1528         * pthread.c (pthread_handle_sigcancel_rt): GS has been renamed to
1529         REG_GS.
1530         (pthread_handle_sigrestart_rt): Likewise.
1531         * signals.c (pthread_sighandler_rt): Likewise.
1532
1533 2000-03-02  Andreas Jaeger  <aj@suse.de>
1534
1535         * sysdeps/pthread/bits/libc-lock.h: Fix typo.
1536         Reported by Sean Chen <sean.chen@turbolinux.com>.
1537
1538 2000-02-28  Andreas Jaeger  <aj@suse.de>
1539
1540         * rwlock.c: Fix typo.
1541
1542 2000-02-27  Ulrich Drepper  <drepper@redhat.com>
1543
1544         * rwlock.c: Define __* variants of the functions and make old names
1545         aliases.
1546         * Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
1547         * sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
1548
1549 2000-02-25  Andreas Jaeger  <aj@suse.de>
1550
1551         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1552         pwrite64, lseek64, open64, and __open64 with version 2.2.
1553
1554 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
1555
1556         * semaphore.h (SEM_FAILED): Use 0 not NULL.
1557
1558 2000-02-14  Ulrich Drepper  <drepper@redhat.com>
1559
1560         * condvar.c (pthread_cond_timedwait_relative_old): Tight loop with
1561         nanosleep does not work either.  Get absolute time inside the
1562         loop.
1563         (pthread_cond_timedwait_relative_new): Likewise.
1564         Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
1565
1566 2000-02-13  Andreas Jaeger  <aj@suse.de>
1567
1568         * condvar.c (pthread_cond_timedwait_relative_new): Fix last patch.
1569         (pthread_cond_timedwait_relative_old): Likewise.
1570
1571 2000-02-13  Ulrich Drepper  <drepper@redhat.com>
1572
1573         * condvar.c (pthread_cond_timedwait_relative_old): Undo last patch
1574         but keep the code around.  A bug in the kernel prevent us from
1575         using the code.
1576         (pthread_cond_timedwait_relative_new): Likewise.
1577         (PR libc/1597 and libc/1598).
1578
1579 2000-02-01  Kaz Kylheku  <kaz@ashi.footprints.net>
1580
1581         * condvar.c (pthread_cond_timedwait_relative_old): Do tight
1582         loop around nanosleep calls instead of around most of the function
1583         (pthread_cond_timedwait_relative_new): Likewise.
1584         body.  Got rid of backwards goto and one local.
1585
1586 2000-01-31  Ulrich Drepper  <drepper@redhat.com>
1587
1588         * condvar.c (pthread_cond_timedwait_relative_old): Recompute time
1589         before every nanosleep call to account for time spent in the rest
1590         of the function.
1591         (pthread_cond_timedwait_relative_new): Likewise.
1592         Patch by khendricks@ivey.uwo.ca (PR libc/1564).
1593
1594 2000-01-29  Ulrich Drepper  <drepper@redhat.com>
1595
1596         * condvar.c (pthread_cond_timedwait_relative_old): Get remaining time
1597         from nanosleep call so that in case we restart we only wait for the
1598         remaining time.
1599         (pthread_cond_timedwait_relative_new): Likewise.
1600         Patch by khendricks@ivey.uwo.ca (PR libc/1561).
1601
1602 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
1603
1604         * manager.c (pthread_allocate_stack): Compute guard page address
1605         correctly.  Patch by HJ Lu.
1606
1607         * sysdeps/pthread/pthread.h: Define
1608         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
1609
1610 2000-01-16  Ulrich Drepper  <drepper@cygnus.com>
1611
1612         * rwlock.c (pthread_rwlock_unlock): Correct one more problem with
1613         preference handling.
1614         (pthread_rwlockattr_setkind_np): Allow
1615         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.
1616         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1617
1618 2000-01-12  Ulrich Drepper  <drepper@cygnus.com>
1619
1620         * internals.h (pthread_readlock_info): New structure.
1621         (_pthread_descr_struct): Add p_readlock_list, p_readlock_free, and
1622         p_untracked_readlock_count.
1623         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1624         Add initializers for new fields.
1625         * manager.c (pthread_free): Free read/write lock lists.
1626         * queue.h (queue_is_empty): New function.
1627         * rwlock.c: Implement requirements about when readers should get
1628         locks assigned.
1629         * sysdeps/pthread/pthread.h
1630         (PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP): New definition.
1631         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_rwlock_t):
1632         Define this name as well.
1633         Patches by Kaz Kylheku <kaz@ashi.footprints.net>.
1634
1635 2000-01-05  Ulrich Drepper  <drepper@cygnus.com>
1636
1637         * pthread.c (__pthread_initial_thread, pthread_manager_thread):
1638         Adjust initializers for struct _pthread_descr_struct change.
1639         * internals.h (struct _pthread_descr_struct): Move new elements to
1640         the end.
1641
1642 2000-01-03  Kaz Kylheku  <kaz@ashi.footprints.net>
1643
1644         Redesigned how cancellation unblocks a thread from internal
1645         cancellation points (sem_wait, pthread_join,
1646         pthread_cond_{wait,timedwait}).
1647         Cancellation won't eat a signal in any of these functions
1648         (*required* by POSIX and Single Unix Spec!).
1649         * condvar.c: Spontaneous wakeup on pthread_cond_timedwait won't eat a
1650         simultaneous condition variable signal (not required by POSIX
1651         or Single Unix Spec, but nice).
1652         * spinlock.c: __pthread_lock queues back any received restarts
1653         that don't belong to it instead of assuming ownership of lock
1654         upon any restart; fastlock can no longer be acquired by two threads
1655         simultaneously.
1656         * restart.h: Restarts queue even on kernels that don't have
1657         queued real time signals (2.0, early 2.1), thanks to atomic counter,
1658         avoiding a rare race condition in pthread_cond_timedwait.
1659
1660 1999-12-31  Andreas Jaeger  <aj@suse.de>
1661
1662         * internals.h: Remove duplicate prototype declarations.
1663
1664         * weaks.c: Remove __THROW from prototypes since the file is not
1665         compiled by a C++ compiler.
1666         * internals.h: Likewise.
1667
1668 1999-12-30  Andreas Jaeger  <aj@suse.de>
1669
1670         * sysdeps/pthread/pthread.h: Move internal functions to...
1671         * sysdeps/pthread/bits/libc-lock.h: ...here.
1672
1673 1999-12-29  Andreas Jaeger  <aj@suse.de>
1674
1675         * sysdeps/pthread/pthread.h: Fix typos, reformat comments.
1676
1677 1999-12-28  Ulrich Drepper  <drepper@cygnus.com>
1678
1679         * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the
1680         beginning.
1681
1682         * manager.c (__pthread_start): Add one more cast to prevent
1683         warning on 64bit machines.
1684
1685 1999-12-21  Ulrich Drepper  <drepper@cygnus.com>
1686
1687         * manager.c (pthread_handle_create): Set p_pid of new thread
1688         before calling the callback function to report a new thread.
1689
1690 1999-12-20  Andreas Jaeger  <aj@suse.de>
1691
1692         * pthread.c (pthread_initialize): Move getrlimit call after
1693         setting of errno.
1694
1695 1999-12-18  Ulrich Drepper  <drepper@cygnus.com>
1696
1697         * Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
1698         pwrite64, lseek64, open64, and __open64.
1699         * wrapsyscall.c: Define pread, __pread64, pread64, pwrite, __pwrite64,
1700         pwrite64, lseek64, open64, and __open64.
1701
1702         * manager.c (pthread_allocate_stack): Correct computation of
1703         new_thread_bottom.  Correct handling of stack size and when the
1704         rlimit method to guard for stack growth is used.
1705         * pthread.c (pthread_initialize): Stack limit must be STACK_SIZE
1706         minus one pagesize (not two).
1707
1708 1999-12-03  Andreas Jaeger  <aj@suse.de>
1709
1710         * Versions: Add __res_state with version GLIBC_2.2.
1711
1712         * errno.c (__res_state): New function to return thread specific
1713         resolver state.
1714
1715         * pthread.c (pthread_initialize): Initialize p_resp.
1716         (__pthread_reset_main_thread): Also set p_resp.
1717
1718         * manager.c (pthread_handle_create): Initialize p_resp.
1719
1720         * internals.h: Add thread specific resolver state.
1721         Based on patches by Adam D. Bradley <artdodge@cs.bu.edu>.
1722
1723 1999-12-01  Ulrich Drepper  <drepper@cygnus.com>
1724
1725         * sysdeps/i386/pt-machine.h: Move stack_pointer definition to the
1726         beginning.
1727         * sysdeps/i386/i686/pt-machine.h: Likewise.
1728         Patches by Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>.
1729
1730 1999-11-23  Ulrich Drepper  <drepper@cygnus.com>
1731
1732         * manager.c (pthread_start_thread_event): Initialize p_pid already
1733         here.
1734
1735 1999-11-22  Ulrich Drepper  <drepper@cygnus.com>
1736
1737         * internals.h: Add prototype for __pthread_manager_event.
1738         * manager.c (__pthread_manager_event): New function.
1739         (pthread_start_thread_event): Correct computation of self.
1740         Use INIT_THREAD_SELF.
1741         * pthread.c (__pthread_manager_thread): Initialize p_lock.
1742         (__pthread_initialize_manager): Respect event flags also for creation
1743         of the manager thread.
1744
1745 1999-11-08  Ulrich Drepper  <drepper@cygnus.com>
1746
1747         * pthread.c (__pthread_initialize_manager): Initialize
1748         __pthread_manager_thread.p_tid.
1749
1750 1999-11-02  Ulrich Drepper  <drepper@cygnus.com>
1751
1752         * internals.h: Declare __pthread_last_event.
1753         * manager.c: Define __pthread_last_event.
1754         (pthread_handle_create): Set __pthread_last_event.
1755         (pthread_exited): Likewise.
1756         * join.c (pthread_exit): Likewise.
1757
1758         * Makefile (libpthread-routines): Add events.
1759         * events.c: New file.
1760         * internals.h: Protect against multiple inclusion.
1761         Include thread_dbP.h header.
1762         (struct _pthread_descr_struct): Add new fields p_report_events and
1763         p_eventbuf.
1764         Declare event reporting functions.
1765         * join.c (pthread_exit): Signal event if this is wanted.
1766         * manager.c (__pthread_threads_events): New variable.
1767         (pthread_handle_create): Take new parameters with event information.
1768         Signal TD_CREATE event if wanted.
1769         (__pthread_manager): Adjust pthread_handle_create call.
1770         (pthread_start_thread_event): New function.  Block until manager is
1771         finished and then call pthread_start_thread.
1772         (pthread_exited): Signal TD_REAP event if wanted.
1773
1774 1999-10-26  Ulrich Drepper  <drepper@cygnus.com>
1775
1776         * restart.h (suspend_with_cancellation): Rewrite as a macro.
1777
1778         * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
1779
1780 1999-10-25  Andreas Jaeger  <aj@suse.de>
1781
1782         * internals.h: Remove K&R compatibility.
1783         * no-tsd.c: Likewise.
1784         * semaphore.h: Likewise.
1785         * signals.c: Likewise.
1786         * sysdeps/pthread/bits/libc-tsd.h: Likewise.
1787         * sysdeps/unix/sysv/linux/bits/sigthread.h: Likewise.
1788         * weaks.c: Likewise.
1789
1790 1999-10-21  Xavier Leroy  <Xavier.Leroy@inria.fr>
1791
1792         * pthread.c: For i386, wrap pthread_handle_sigrestart and
1793         pthread_handle_sigcancel with functions that restore %gs from the
1794         signal context.  For each signal handling function, two wrappers
1795         are required, one for a non-RT signal and one for a RT signal.
1796         * signal.c: For i386, add code to restore %gs from the signal
1797         context in pthread_sighandler and pthread_sighandler_rt.
1798
1799 1999-10-17  Ulrich Drepper  <drepper@cygnus.com>
1800
1801         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add cast.
1802
1803 1999-10-14  Ulrich Drepper  <drepper@cygnus.com>
1804
1805         * pthread.c (__pthread_initial_thread): Pass argument to
1806         PTHREAD_START_ARGS_INITIALIZER.
1807         (__pthread_manager_thread): Likewise.
1808
1809         * internals.h (PTHREAD_START_ARGS_INITIALIZER): Add parameter to
1810         initialize function.
1811
1812         * manager.c (pthread_handle_create): Remove p_startfct initialization.
1813
1814         * internals.h (_pthread_descr_struct): We don't need p_startfct field.
1815
1816 1999-10-12  Ulrich Drepper  <drepper@cygnus.com>
1817
1818         * internals.h: Correct return types for __libc_read and __libc_write.
1819
1820 1999-10-09  Andreas Jaeger  <aj@suse.de>
1821
1822         * internals.h: Add __new_sem_post to get prototype in
1823         manager.c; include semaphore.h for needed types.
1824
1825 1999-10-08  Ulrich Drepper  <drepper@cygnus.com>
1826
1827         * manager.c (__pthread_manager) [REQ_POST]: Use __new_sem_post
1828         directly instead of calling sem_post which should not be necessary
1829         but is faster and might help in some case to work around problems.
1830         Patch by khendricks@ivey.uwo.ca [libc/1382].
1831
1832 1999-10-08  Andreas Schwab  <schwab@suse.de>
1833
1834         * sysdeps/pthread/Subdirs: New file.
1835         * Implies: Removed.
1836
1837 1999-10-07  Ulrich Drepper  <drepper@cygnus.com>
1838
1839         * Implies: New file.
1840         * internals.h (struct _pthread_descr_struct): Add p_startfct.
1841         * manager.c (pthread_handle_create): Initialize p_startfct.
1842         * pthread.c: Define __linuxthread_pthread_sizeof_descr variable.
1843
1844 1999-09-25  Ulrich Drepper  <drepper@cygnus.com>
1845
1846         * manager.c (__linuxthreads_pthread_threads_max): New variable.
1847         * specific.c (__linuxthreads_pthread_keys_max): New variable.
1848         (__linuxthreads_pthread_key_2ndlevel_size): New variable.
1849
1850         * condvar.c (pthread_cond_timedwait_relative): Never return with
1851         EINTR.  Patch by Andreas Schwab.
1852
1853 1999-09-19  Ulrich Drepper  <drepper@cygnus.com>
1854
1855         * signals.c (sigaction): Correct last patch.  Don't select
1856         pthread_sighandler_rt based on the signal number but instead of
1857         the SA_SIGINFO flag.
1858
1859 1999-09-23  Ulrich Drepper  <drepper@cygnus.com>
1860
1861         * specific.c: Move definitions of struct pthread_key_struct and
1862         destr_function to ...
1863         * internals.h: ...here.
1864
1865 1999-09-18  Ulrich Drepper  <drepper@cygnus.com>
1866
1867         * pthread.c (pthread_handle_sigrestart_rt): New function.  Use
1868         this instead of pthread_handle_sigrestart if the signal is an RT
1869         signal.
1870
1871         * signals.c: Handle passing through of sighandler arguments also
1872         for real-time signals.
1873
1874 1999-09-03  Andreas Schwab  <schwab@suse.de>
1875
1876         * ptfork.c (__fork): Renamed from fork and use __libc_fork.  Add
1877         fork as weak alias.
1878         (__vfork): New function, alias vfork.
1879         * Versions: Export __fork, vfork, and __vfork in libpthread.
1880
1881 1999-08-23  Andreas Schwab  <schwab@suse.de>
1882
1883         * signals.c (pthread_sighandler): Add SIGCONTEXT_EXTRA_ARGS to
1884         call to signal handler.
1885
1886 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
1887
1888         * pthread.c (__pthread_reset_main_thread): Undo last change.
1889         (__pthread_kill_other_threads_np): Reset signal handlers for the
1890         signals we used in the thread implementation here.
1891
1892 1999-08-19  Ulrich Drepper  <drepper@cygnus.com>
1893
1894         * pthread.c (__pthread_reset_main_thread): Reset signal handlers
1895         for the signals we used in the thread implementation [PR libc/1234].
1896
1897         * Versions: Export __pthread_kill_other_threads_np from libpthread
1898         for GLIBC_2.1.2.
1899
1900         * signals.c: Pass sigcontext through wrapper to the user function.
1901
1902 1999-08-01  Ulrich Drepper  <drepper@cygnus.com>
1903
1904         * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and
1905         __libc_internal_tsd_set.
1906
1907 1999-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
1908
1909         * manager.c: Remove inclusion of <linux/tasks.h> since it's not
1910         needed anymore.
1911
1912 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
1913
1914         * internals.h: Align _pthread_descr_struct to 32 bytes.
1915         Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
1916         libc/1206.
1917
1918 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
1919
1920         * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
1921         swap function.
1922
1923 1999-07-09  Cristian Gafton  <gafton@redhat.com>
1924
1925         * Makefile (libpthread-routines): Add oldsemaphore routine.
1926         * Versions: Add sem_destroy, sem_getvalue, sem_init, sem_post,
1927         sem_trywait, and sem_wait to GLIBC_2.1.
1928         * oldsemaphore.c: New file.
1929         * semaphore.c: Add default_symbol_versions for the changed functions.
1930         (__new_sem_init): Rename from sem_init.
1931         (__new_sem_post): Rename from sem_post.
1932         (__new_sem_wait): Rename from sem_wait.
1933         (__new_sem_trywait): Rename from sem_trywait.
1934         (__new_sem_getvalue): Rename from sem_getvalue.
1935         (__new_sem_destroy): Rename from sem_destroy.
1936
1937 1999-06-23  Robey Pointer  <robey@netscape.com>
1938
1939         * internals.h: Added p_nextlock entry to separate queueing for a
1940         lock from queueing for a CV (sometimes a thread queues on a lock
1941         to serialize removing itself from a CV queue).
1942         * pthread.c: Added p_nextlock to initializers.
1943         * spinlock.c: Changed to use p_nextlock instead of p_nextwaiting.
1944
1945 1999-07-09  Ulrich Drepper  <drepper@cygnus.com>
1946
1947         * manager.c (pthread_handle_create): Free mmap region after stack
1948         if clone failed.  Patch by Kaz Kylheku <kaz@ashi.FootPrints.net>.
1949
1950 1999-05-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
1951
1952         * man/pthread_cond_init.man: Correct example.
1953         Reported by Tomas Berndtsson <tomas@nocrew.org>.
1954
1955         * linuxthreads.texi (Condition Variables): Likewise.
1956
1957 1999-05-18  Jakub Jelinek  <jj@ultra.linux.cz>
1958
1959         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): Use
1960         casx not cas, also successful casx returns the old value in rd
1961         and not the new value.
1962
1963 1999-05-16  Xavier Leroy  <Xavier.Leroy@inria.fr>
1964
1965         * manager.c: If pthread_create() is given a NULL attribute
1966         and the thread manager runs with a realtime policy, set the
1967         scheduling policy of the newly created thread back to SCHED_OTHER.
1968         * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given,
1969         initialize the schedpolicy field of new_thread->p_start_args
1970         to that of the calling thread.
1971
1972 1999-04-29  Ulrich Drepper  <drepper@cygnus.com>
1973
1974         * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas
1975         instruction does not allow memory element to use offset.
1976
1977 1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
1978
1979         * manager.c (pthread_allocate_stack): Optimize initialization of new
1980         thread descriptor.
1981
1982         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_define_initialized):
1983         Don't use initializer since it is all zeroes.
1984         (__libc_once_define): Likewise.
1985
1986 1999-04-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
1987
1988         * sysdeps/arm/Implies: Removed since cmpxchg/no-cmpxchg
1989         doesn't exist anymore.
1990         * sysdeps/i386/Implies: Likewise.
1991         * sysdeps/m68k/Implies: Likewise.
1992         * sysdeps/mips/Implies: Likewise.
1993         * sysdeps/powerpc/Implies: Likewise.
1994         * sysdeps/sparc/sparc32/Implies: Likewise.
1995         * sysdeps/sparc/sparc64/Implies: Likewise.
1996
1997 1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
1998
1999         * sysdeps/alpha/bits/semaphore.h: Removed.
2000         * sysdeps/powerpc/bits/semaphore.h: Removed.
2001         * sysdeps/pthread/cmpxchg/bits/semaphore.h: Removed.
2002         * sysdeps/pthread/no-cmpxchg/bits/semaphore.h: Removed.
2003         * Makefile (headers): Remove bits/semaphore.h.
2004
2005         * semaphore.h: Define _pthread_descr if necessary.
2006         Don't include limits.h.  Define SEM_VALUE_MAX directly.
2007         Define SEM_FAILED.
2008         (sem_t): Protect element names with leading __.
2009         Add declarations for sem_close, sem_open, and sem_unlink.
2010         * semaphore.c: Adjust all functions for new element names.
2011         Define sem_close, sem_open, and sem_unlink.
2012         * Versions (libthread): Add sem_close, sem_open, and sem_unlink for
2013         GLIBC_2.1.1.
2014         * sysdeps/pthread/bits/pthreadtypes.h: Define _pthread_descr only if
2015         necessary.
2016
2017 1999-03-16  H.J. Lu  <hjl@gnu.org>
2018
2019         * specific.c (pthread_key_delete): Check th->p_terminated to see
2020         if the thread is running.
2021
2022         * Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
2023         Added to GLIBC_2.0 for libc.so.
2024
2025 1999-02-12  H.J. Lu  <hjl@gnu.org>
2026
2027         * Versions (__libc_current_sigrtmin, __libc_current_sigrtmax,
2028         __libc_allocate_rtsig): Added to GLIBC_2.1.
2029
2030         * internals.h (DEFAULT_SIG_RESTART): Removed.
2031         (DEFAULT_SIG_CANCEL): Removed.
2032
2033         * pthread.c (init_rtsigs, __libc_current_sigrtmin,
2034         __libc_current_sigrtmax, __libc_allocate_rtsig): New functions.
2035         (__pthread_sig_restart, __pthread_sig_cancel,
2036         __pthread_sig_debug): Initialized.
2037         (pthread_initialize): Call init_rtsigs () to initialize
2038         real-time signals.
2039
2040 1999-02-03  H.J. Lu  <hjl@gnu.org>
2041
2042         * manager.c (__pthread_manager): Do block __pthread_sig_debug.
2043         Don't restart the thread which sent REQ_DEBUG.
2044         (pthread_start_thread): Check if __pthread_sig_debug > 0
2045         before debugging.
2046
2047         * pthread.c (__pthread_initialize_manager): Suspend ourself
2048         after sending __pthread_sig_debug to gdb instead of
2049         __pthread_sig_cancel.
2050
2051 1999-01-24  H.J. Lu  <hjl@gnu.org>
2052
2053         * manager.c (__pthread_manager): Delete __pthread_sig_debug
2054         from mask if __pthread_sig_debug > 0.
2055         (pthread_handle_create): Increment __pthread_handles_num.
2056
2057         * manager.c (pthread_handle_create): Don't pass CLONE_PTRACE to clone.
2058         * pthread.c (__pthread_initialize_manager): Likewise.
2059
2060         * pthread.c (pthread_initialize): Use __libc_allocate_rtsig (1)
2061         instead of __libc_allocate_rtsig (2).
2062         (__pthread_initialize_manager): Send __pthread_sig_debug to gdb
2063         instead of __pthread_sig_cancel.
2064         (pthread_handle_sigdebug): Fix comments.
2065
2066 1999-01-21  Ulrich Drepper  <drepper@cygnus.com>
2067
2068         * manager.c (pthread_allocate_stack): Set
2069         __pthread_nonstandard_stacks if user-specified stack is used.
2070
2071 1999-01-16  Ulrich Drepper  <drepper@cygnus.com>
2072
2073         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Add _LFS_ASYNCHRONOUS_IO,
2074         _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO from Unix98.
2075
2076 1999-01-07  Xavier Leroy  <Xavier.Leroy@inria.fr>
2077
2078         * pthread.c: Use a third signal __pthread_sig_debug distinct
2079         from __pthread_sig_cancel to notify gdb when a thread is
2080         created
2081         * manager.c: Likewise.
2082         * internals.h: Likewise.
2083         * signals.c: The implementation of sigwait(s) assumed that
2084         all signals in s have signal handlers already attached.
2085         This is not required by the standard, so make it work
2086         also if some of the signals have no handlers.
2087
2088 1999-01-05  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
2089
2090         * linuxthreads.texi: Remove pointers from first @node.  Move old
2091         @node spec inside comment.
2092
2093 1998-12-31  Ulrich Drepper  <drepper@cygnus.com>
2094
2095         * sysdeps/pthread/bits/stdio-lock.h: Define _IO_lock_lock and
2096         _IO_lock_unlock.
2097
2098 1998-12-29  Ulrich Drepper  <drepper@cygnus.com>
2099
2100         * semaphore.c (sem_trywait): Don't forget to unlock the semaphore
2101         lock.  Patch by Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>.
2102
2103 1998-12-21  Ulrich Drepper  <drepper@cygnus.com>
2104
2105         * manager.c: Threads now send __pthread_sig_cancel on termination.
2106         Change clone call and signal masks.
2107         * thread.c (pthread_handle_sigrestart): Remove special code for
2108         manager.
2109         (pthread_handle_sigcancel): In manager thread call
2110         __pthread_manager_sighandler.
2111         * sysdeps/i386/pt-machine.h (__compare_and_swap): Add memory clobber.
2112         * sysdeps/i386/i686/pt-machine.h: Likewise.
2113         Patches by Xavier Leroy.
2114
2115 1998-12-14  Ulrich Drepper  <drepper@cygnus.com>
2116
2117         * spinlock.c (__pthread_unlock): Don't crash if called for an
2118         untaken mutex.  Reported by Ruslan V. Brushkoff <rus@Snif.Te.Net.UA>.
2119
2120         * Examples/ex6.c: Unbuffer stdout and reduce sleep time to reduce
2121         overall runtime.
2122
2123 1998-12-13  Ulrich Drepper  <drepper@cygnus.com>
2124
2125         * Examples/ex3.c: Wait until all threads are started before
2126         searching for the number to avoid race condition on very fast
2127         systems.
2128
2129 1998-12-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2130
2131         * sysdeps/pthread/pthread.h: Remove __pthread_setcanceltype
2132         declaration since it's not needed.
2133
2134         * sysdeps/pthread/pthread.h: Move internal functions to ...
2135         * internals.h: ...here.
2136
2137 1998-12-02  H.J. Lu  <hjl@gnu.org>
2138
2139         * pthread.c (__pthread_sig_restart): Initiliaze to 0 if
2140         SIGRTMIN is defined.
2141         (__pthread_sig_cancel): Likewise.
2142
2143 1998-12-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2144
2145         * wrapsyscall.c: Include <sys/mman.h> for msync,
2146         <stdlib.h> for system and <termios.h> for tcdrain prototype.
2147         Correct msync declaration.
2148
2149 1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
2150
2151         * sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
2152         __libc_tsd_set): New macros for new interface.
2153         * no-tsd.c: New file, provide uninitialized defns of
2154         __libc_internal_tsd_get and __libc_internal_tsd_set.
2155         * Makefile (routines): Add no-tsd.
2156
2157 1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
2158
2159         * internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
2160         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2161         __libc_internal_tsd_set): Move decls to ...
2162         * sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
2163         declarations.
2164
2165         * sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
2166         __libc_internal_tsd_set): Make these pointers to functions, not
2167         functions; remove #pragma weak decls for them.
2168         * specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
2169         Define static functions and initialized pointers to them.
2170
2171 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
2172
2173         * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
2174         (CFLAGS-specific.c): Likewise.
2175         (CFLAGS-pthread.c): Likewise.
2176         (CFLAGS-ptfork.c): Likewise.
2177         (CFLAGS-cancel.c): Likewise.
2178         * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
2179         as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
2180
2181         * mutex.c (pthread_mutex_init): Define as strong symbol.
2182         (pthread_mutex_destroy): Likewise.
2183         (pthread_mutex_trylock): Likewise.
2184         (pthread_mutex_lock): Likewise.
2185         (pthread_mutex_unlock): Likewise.
2186         (pthread_mutexattr_init): Likewise.
2187         (pthread_mutexattr_destroy): Likewise.
2188         (pthread_once): Likewise.
2189         * ptfork.c (pthread_atfork): Likewise.
2190         * specific.c (pthread_key_create): Likewise.
2191         (pthread_setspecific): Likewise.
2192         (pthread_getspecific): Likewise.
2193
2194 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
2195
2196         * linuxthreads.texi: Fix punctuation after xref.
2197
2198 1998-11-10  H.J. Lu  <hjl@gnu.org>
2199
2200         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine NR_OPEN
2201         if it is defined in <linux/limits.h>.
2202
2203 1998-10-29 14:28  Ulrich Drepper  <drepper@cygnus.com>
2204
2205         * spinlock.h (__pthread_trylock): Define inline.
2206         (__pthread_lock): Add extra parameter to declaration.  Declare
2207         using internal_function.
2208         (__pthread_unlock): Declare using internal_function.
2209         * spinlock.c (__pthread_lock): Add new parameter.  Use it instead
2210         of local variable self.  Avoid recomputing self.  Define using
2211         internal_function.
2212         (__pthread_trylock): Remove.
2213         (__pthread_unlock): Define using internal_function.
2214         * cancel.c: Adjust for __pthread_lock interface change.  Use already
2215         computed self value is possible.
2216         * condvar.c: Likewise.
2217         * join.c: Likewise.
2218         * manager.c: Likewise.
2219         * mutex.c: Likewise.
2220         * pthread.c: Likewise.
2221         * rwlock.c: Likewise.
2222         * semaphore.c: Likewise.
2223         * signals.c: Likewise.
2224
2225 1998-10-27 13:46  Ulrich Drepper  <drepper@cygnus.com>
2226
2227         * sysdeps/pthread/pthread.h (struct _pthread_cleanup_buffer): Prepend
2228         __ to field names of the struct.
2229         * sysdeps/pthread/bits/pthreadtypes.h (struct _pthread_fastlock):
2230         Likewise.
2231         (pthread_attr_t): Likewise.
2232         (pthread_cond_t): Likewise.
2233         (pthread_condattr_t): Likewise.
2234         (pthread_mutex_t): Likewise.
2235         (pthread_mutexattr_t): Likewise.
2236         (pthread_rwlock_t): Likewise.
2237         (pthread_rwlockattr_t): Likewise.
2238         * attr.c: Adjust for pthread.h and pthreadtypes.h change.
2239         * cancel.c: Likewise.
2240         * condvar.c: Likewise.
2241         * manager.c: Likewise.
2242         * mutex.c: Likewise.
2243         * pthread.c: Likewise.
2244         * ptlongjmp.c: Likewise.
2245         * rwlock.c: Likewise.
2246         * spinlock.c: Likewise.
2247
2248 1998-10-09  Ulrich Drepper  <drepper@cygnus.com>
2249
2250         * sysdeps/i386/pt-machine.h (get_eflags, set_eflags): Mark these
2251         also with PT_EI.
2252
2253         * sysdeps/i386/i686/pt-machine.h: Remove unused inline
2254         definitions.
2255
2256         * Makefile (libpthread-routines): Add pt-machine.
2257         * pt-machine.c: New file.
2258         * sysdeps/alpha/pt-machine.h: Define PT_EI as extern inline is not
2259         yet defined.  Use PT_EI in extern inline definitions.
2260         * sysdeps/arm/pt-machine.h: Likewise.
2261         * sysdeps/i386/pt-machine.h: Likewise.
2262         * sysdeps/i386/i686/pt-machine.h: Likewise.
2263         * sysdeps/m68k/pt-machine.h: Likewise.
2264         * sysdeps/mips/pt-machine.h: Likewise.
2265         * sysdeps/powerpc/pt-machine.h: Likewise.
2266         * sysdeps/sparc/sparc32/pt-machine.h: Likewise.
2267         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2268
2269 1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2270
2271         * semaphore.h: Include <sys/types.h> so that _pthread_descr
2272         is declared.
2273
2274 1998-09-15  David S. Miller  <davem@pierdol.cobaltmicro.com>
2275
2276         * sysdeps/sparc/sparc32/pt-machine.h (INIT_THREAD_SELF): Add nr
2277         argument.
2278         * sysdeps/sparc/sparc64/pt-machine.h (INIT_THREAD_SELF): Likewise.
2279
2280 1998-09-12 14:24 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
2281
2282         * sysdeps/unix/sysv/linux/bits/sigthread.h: Add multiple inclusion
2283         guard.
2284
2285 1998-09-02 11:08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2286
2287         * signals.c (sigaction): Check that sig is less than NSIG to avoid
2288         array index overflow.
2289
2290 1998-09-06 10:56  Ulrich Drepper  <drepper@cygnus.com>
2291
2292         * sysdeps/pthread/semaphore.h: New file.
2293
2294 1998-09-06 09:08  Ulrich Drepper  <drepper@cygnus.com>
2295
2296         * sysdeps/pthread/bits/libc-lock.h (enum __libc_tsd_key_t): Add
2297         _LIBC_TSD_KEY_DL_ERROR.
2298
2299 1998-08-31  Ulrich Drepper  <drepper@cygnus.com>
2300
2301         * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
2302         * sysdeps/i386/pt-machine.h: Likewise.
2303         Suggested by Roland McGrath.
2304
2305 1998-08-28 13:58  Ulrich Drepper  <drepper@cygnus.com>
2306
2307         * internals.h: Also define THREAD_GETMEM_NC and THREAD_SETMEM_NC to
2308         access thread data with non-constant offsets.
2309         * specific.c: Use THREAD_GETMEM_NC and THREAD_SETMEM_NC where
2310         necessary.
2311
2312         * sysdeps/i386/useldt.h: Fix typo.  Add THREAD_GETMEM_NC and
2313         THREAD_SETMEM_NC definitions.
2314
2315         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM_NC and
2316         THREAD_SETMEM_NC.
2317         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2318
2319 1998-08-26 15:46  Ulrich Drepper  <drepper@cygnus.com>
2320
2321         * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
2322         not already defined.
2323         (struct _pthread_descr_struct): Add p_self and p_nr field.
2324         * manager.c (__pthread_handles): Define second element to point
2325         to manager thread.
2326         (__pthread_handles_num): Initialize to 2.
2327         (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
2328         (pthread_start_thread): Likewise.
2329         (pthread_handle_create): Start search for free slot at entry 2.
2330         Initialize new fields p_self and p_nr.
2331         Call __clone with CLONE_PTRACE if available.
2332         (pthread_free): Call FREE_THREAD_SELF if available.
2333         * pthread.c (__pthread_initial_thread): Initialize new fields.
2334         (__pthread_manager_thread): Likewise.
2335         (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
2336
2337         * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
2338         elements of the thread descriptor.
2339         * condvar.c: Likewise.
2340         * errno.c: Likewise.
2341         * join.c: Likewise.
2342         * manager.c: Likewise.
2343         * pthread.c: Likewise.
2344         * ptlongjmp.c: Likewise.
2345         * semaphore.c: Likewise.
2346         * signals.c: Likewise.
2347         * specific.c: Likewise.
2348         * spinlock.c: Likewise.
2349
2350         * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
2351
2352         * sysdeps/i386/useldt.h: New file.
2353         * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
2354
2355         * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
2356         THREAD_SETMEM using __thread_self.
2357         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2358
2359 1998-08-24  Geoff Keating  <geoffk@ozemail.com.au>
2360
2361         * spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
2362         turned out that we didn't need to queue after all.
2363
2364 1998-08-22  Geoff Keating  <geoffk@ozemail.com.au>
2365
2366         * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used
2367         and wastes space; correct types.
2368
2369 1998-08-08 11:18  H.J. Lu  <hjl@gnu.org>
2370
2371         * signals.c (sigaction): Handle NULL argument.
2372
2373 1998-08-04  Ulrich Drepper  <drepper@cygnus.com>
2374
2375         * sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
2376         of sigset_t.
2377
2378 1998-08-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2379
2380         * Makefile (linuxthreads-version): Extract correct number from
2381         Banner.
2382
2383 1998-07-29  Xavier Leroy  <Xavier.Leroy@inria.fr>
2384
2385         * Banner: Bump version number to 0.8
2386         * FAQ.html: Many updates, in particular w.r.t. debugging.
2387         * manager.c: Support for non-default stacksize for
2388         LinuxThreads-allocated stacks;
2389         don't use guard pages for stacks with default size, rely on
2390         rlimit(RLIMIT_STACK) instead (it's cheaper).
2391         * attr.c: Likewise.
2392         * cancel.c: Use __pthread_sig_cancel and __pthread_sig_restart
2393         everywhere instead of PTHREAD_SIG_CANCEL and PTHREAD_SIG_RESTART.
2394         * condvar.c: Likewise.
2395         * internals.h: Likewise.
2396         * restart.h: Likewise.
2397         * signals.c: Likewise.
2398         * pthread.c: Likewise; set rlimit(RLIMIT_STACK) as we need it.
2399
2400 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2401
2402         * weaks.c: Define pthread_mutexattr_[sg]ettype instead of
2403         __pthread_mutexattr_[sg]ettype.  Add more weak aliases.
2404         * Versions: Put __pthread_mutexattr_settype under version
2405         GLIBC_2.0.  Don't export __pthread_mutexattr_setkind_np and
2406         __pthread_mutexattr_gettype.
2407
2408 1998-07-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2409
2410         * sysdeps/pthread/bits/libc-lock.h: Make
2411         __pthread_mutexattr_settype weak.  Don't make
2412         __pthread_mutexattr_setkind_np weak.
2413
2414 1998-07-16 10:52  Ulrich Drepper  <drepper@cygnus.com>
2415
2416         * manager.c (pthread_handle_create): Check whether sched_setscheduler
2417         call can succeed here.
2418
2419         * mutex.c: Define __pthread_mutexattr_settype and make
2420         __pthread_mutexattr_setkind_np an alias.
2421         Likewise for __pthread_mutexattr_gettype.
2422
2423 1998-07-15 11:00 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
2424
2425         * attr.c (pthread_attr_setschedpolicy): Don't check whether caller
2426         is root.
2427
2428 1998-07-14 19:38  Ulrich Drepper  <drepper@cygnus.com>
2429
2430         * sysdeps/pthread/bits/libc-lock.h: Define __libc_cleanup_end.
2431
2432 1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2433
2434         * Examples/ex6.c: Include <unistd.h> for usleep.
2435
2436 1998-06-13 11:04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2437
2438         * Examples/ex4.c (main): Use exit, not pthread_exit.
2439
2440 1998-07-09 13:39  Ulrich Drepper  <drepper@cygnus.com>
2441
2442         * Versions: Add __pthread_mutexattr_gettype and
2443         __pthread_mutexattr_settype.
2444         * lockfile.c: Use __pthread_mutexattr_settype instead of
2445         __pthread_mutexattr_setkind_np.
2446         * mutex.c: Define __pthread_mutexattr_gettype and
2447         __pthread_mutexattr_settype.
2448         * weak.c: Likewise.
2449         * sysdeps/pthread/pthread.h: Declare __pthread_mutexattr_gettype and
2450         __pthread_mutexattr_settype.
2451         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_init_recursive):
2452         Use __pthread_mutexattr_settype.
2453
2454 1998-07-08 22:26  Ulrich Drepper  <drepper@cygnus.com>
2455
2456         * Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
2457         * mutex.c: Define weak alias pthread_mutexattr_gettype and
2458         pthread_mutexattr_settype.
2459         * sysdeps/pthread/pthread.h: Declare these functions.
2460         Move pthread_sigmask and pthread_kill declaration in separate header.
2461         * sysdeps/unix/sysv/linux/bits/sigthread.h: New file.
2462
2463 1998-07-07 15:20  Ulrich Drepper  <drepper@cygnus.com>
2464
2465         * Makefile: Add rules to compile and run tests.
2466         * Examples/ex1.c: Little changes to fix warnings.
2467         * Examples/ex2.c: Likewise.
2468         * Examples/ex3.c: Likewise.
2469         * Examples/ex4.c: Likewise.
2470         * Examples/ex5.c: Likewise.
2471         * Examples/ex6.c: New file.
2472
2473 1998-07-05 11:54  Ulrich Drepper  <drepper@cygnus.com>
2474
2475         * Versions: Add pthread_attr_init to GLIBC_2.1 version in libc.
2476
2477 1998-07-01  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2478
2479         * attr.c: Include <string.h>.
2480
2481 1998-06-30 11:47  Ulrich Drepper  <drepper@cygnus.com>
2482
2483         * attr.c: Include errno.h.  Use memcpy to copy sched_param.
2484         * internals.h: Include limits.h.
2485         * manager.c: Use memcpy to copy sched_param.
2486         * ptfork.c: Include errno.h.
2487         * pthread.c: Likewise.
2488         * semaphore.c: Likewise.
2489         * specific.c: Likewise.
2490         * spinlock.h: Likewise.
2491         * sysdeps/pthread/pthread.h: Include only allowed headers.  Move
2492         type definition to ...
2493         * sysdeps/pthread/bits/pthreadtypes.h: ...here.  New file.
2494
2495 1998-06-29 12:34  Ulrich Drepper  <drepper@cygnus.com>
2496
2497         * sysdeps/pthread/pthread.h: Use __PMT not __P for function pointers.
2498
2499         * sysdeps/pthread/pthread.h: Define various PTHREAD_* symbols also
2500         as macros as demanded in POSIX.1, Annex C.
2501
2502 1998-06-29 12:29  Ulrich Drepper  <drepper@cygnus.com>
2503
2504         * internals.h (struct pthread_request): For free use pthread_t
2505         instead of pthread_descr.
2506         * join.c (pthread_join): Pass thread_id, not th to manager.
2507         (pthread_detach): Likewise.
2508         * manager.c (__pthread_manager): Except thread ID in FREE_REQ case.
2509         (pthread_exited): Remove detached queue code.
2510         (pthread_handle_free): Expect thread ID parameter and use it to
2511         validate the thread decsriptor.  Don't use detached queue.
2512         Patches by Xavier Leroy.
2513
2514 1998-06-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2515
2516         * libpthread.map: Export accept, longjmp, sigaction, siglongjmp,
2517         _IO_flockfile, _IO_ftrylockfile, _IO_funlockfile,
2518         __pthread_atfork, __pthread_key_create, __pthread_once.
2519         * internals.h: Doc fix.
2520         * pthread.c (__pthread_initialize): Define again.
2521
2522 1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
2523
2524         * manager.c (pthread_exited): If thread is not detached put it on
2525         special list.
2526         (pthread_handle_free): If thread is not on list with living threads
2527         search on list with detached threads.
2528
2529         * sysdeps/pthread/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Correct
2530         for new definition of pthread_rwlock_t.
2531
2532         * spinlock.c: Correct test whether to compile
2533         __pthread_compare_and_swap or not.
2534
2535 1998-06-25 19:27  Ulrich Drepper  <drepper@cygnus.com>
2536
2537         * attr.c: Finish user stack support.  Change locking code to be safe
2538         in situations with different priorities.
2539         * cancel.c: Likewise.
2540         * condvar.c: Likewise.
2541         * internals.h: Likewise.
2542         * join.c: Likewise.
2543         * manager.c: Likewise.
2544         * mutex.c: Likewise.
2545         * pthread.c: Likewise.
2546         * ptlongjmp.c: Likewise.
2547         * queue.h: Likewise.
2548         * rwlock.c: Likewise.
2549         * semaphore.c: Likewise.
2550         * semaphore.h: Likewise.
2551         * signals.c: Likewise.
2552         * spinlock.c: Likewise.
2553         * spinlock.h: Likewise.
2554         * sysdeps/pthread/pthread.h: Likewise.
2555         Patches by Xavier Leroy.
2556
2557         * sysdeps/i386/i686/pt-machine.h: New file.
2558
2559 1998-06-25  Ulrich Drepper  <drepper@cygnus.com>
2560
2561         * sysdeps/pthread/pthread.h: Make [sg]et_stacksize and
2562         [sg]et_stackaddr prototypes always available.
2563
2564         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2565         _POSIX_THREAD_ATTR_STACKSIZE and _POSIX_THREAD_ATTR_STACKADDR.
2566
2567 1998-06-24  Ulrich Drepper  <drepper@cygnus.com>
2568
2569         * manager.c (pthread_free): Undo patch from 980430.
2570         Reported by David Wragg <dpw@doc.ic.ac.uk>.
2571
2572 1998-06-09 15:07  Ulrich Drepper  <drepper@cygnus.com>
2573
2574         * manager.c: Define __pthread_manager_adjust_prio and use it to
2575         increase priority when needed.
2576         * internals.h: Add prototype for __pthread_manager_adjust_prio.
2577         * mutex.c: Optimize mutexes to wake up only one thread.
2578         * pthread.c: Move PID of manager for global variable in structure
2579         element.
2580         Patches by Xavier Leroy.
2581
2582 1998-06-07 13:47  Ulrich Drepper  <drepper@cygnus.com>
2583
2584         * sysdeps/pthread/bits/libc-lock.h: Optimize cleanup handlers a bit.
2585
2586 1998-06-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
2587
2588         * attr.c: Correct typo.
2589
2590 1998-05-01  Ulrich Drepper  <drepper@cygnus.com>
2591
2592         * manager.c (pthread_free): Unmap guard before the stack.
2593         Patch by Matthias Urlichs.
2594
2595 1998-04-30  Ulrich Drepper  <drepper@cygnus.com>
2596
2597         * manager.c (pthread_free): Detect already free child.
2598         Patch by Xavier Leroy, reported by Matthias Urlichs.
2599
2600 1998-04-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2601
2602         * Makefile (linuxthreads-version): Renamed back from
2603         libpthread-version.
2604
2605 1998-04-21  Ulrich Drepper  <drepper@cygnus.com>
2606
2607         * ptlongjmp.c: Add prototypes for __libc_siglongjmp and
2608         __libc_longjmp.
2609
2610 1998-04-20 14:55  Ulrich Drepper  <drepper@cygnus.com>
2611
2612         * Makefile (libpthread-routines): Add ptlongjmp and spinlock.
2613         * internals.h: Add definitions for new spinlock implementation.
2614         * ptlongjmp.c: New file.
2615         * spinlock.c: New file.
2616         * spinlock.h (acquire): Don't reschedule using __sched_yield, use
2617         new function __pthread_acquire to prevent deadlocks with thread
2618         with different priorities.
2619         Patches by Xavier Leroy <Xavier.Leroy@inria.fr>.
2620
2621 1998-03-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2622
2623         * manager.c (__pthread_manager): Reduce first argument to select
2624         to include just the needed file descriptor.
2625
2626 1998-03-17 00:06  Ulrich Drepper  <drepper@cygnus.com>
2627
2628         * manager.c: Fix last patch which caused core dumps.
2629
2630         * pthread.c: Correctly handle missing SIGRTMIN.
2631
2632 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2633
2634         * libpthread.map: Add __libc_internal_tsd_get and
2635         __libc_internal_tsd_set.  Add missing cancelable functions. Export
2636         libc internal versions of the cancelable functions.
2637
2638 1998-03-13 16:51  Ulrich Drepper  <drepper@cygnus.com>
2639
2640         * weaks.c: Define pthread_attr_init as GLIBC_2.0 and GLIBC_2.1.
2641
2642 1998-03-13 00:46  Ulrich Drepper  <drepper@cygnus.com>
2643
2644         * attr.c: Implement pthread_attr_[gs]etguardsize,
2645         pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize.
2646         Change pthread_attr_init to have two interfaces.
2647         * internals.h (struct _pthread_descr_struct): Add new fields for
2648         above functions.
2649         * libpthread.map: Add names in GLIBC_2.1 section.
2650         * manager.c (pthread_handle_create): Implement guardsize and
2651         user stack.
2652         (pthread_free): Likewise.
2653         * pthread.c (pthread_create): Add new interface for changed
2654         pthread_attr_t.
2655         * sysdeps/pthread/pthread.h: Add prototypes for new functions.
2656         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of
2657         PTHREAD_STACK_MIN.
2658
2659 1998-03-11 00:42  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
2660
2661         * manager.c: Enable resetting of the thread scheduling policy
2662         to SCHED_OTHER when the parent thread has a different one.
2663
2664 1998-02-01 13:51  Ulrich Drepper  <drepper@cygnus.com>
2665
2666         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2667         _POSIX_ASYNCHRONOUS_IO.
2668
2669         * sysdeps/pthread/pthread.h: Define bits for Unix98 variants of
2670         mutexes.
2671         * mutex.c: Implement new mutex types.
2672
2673         * internals.h: Include <signal.h>.
2674
2675         * libpthread.map: Add __erno_location and __h_errno_location.
2676
2677         * errno.c: Return pointer to variable actually in use.  This might
2678         not be the one in the thread structure.
2679         * internals.h (struct _pthread_descr_struct): Add new fields p_errnop
2680         and p_h_errnop.
2681         * manager.c (__pthread_manager): Set p_errnop and p_h_errnop member
2682         of manager thread structure.
2683         (pthread_handle_create): Set p_errnop and p_h_errnop members for new
2684         thread.
2685         * pthread.c: Adapt initializer for thread structures.
2686         (__pthread_initial_thread): Set p_errnop and p_h_errnop member.
2687         (__pthread_reset_main_thread): Reset p_errnop and p_h_errnop of
2688         current thread to global variables.
2689
2690 1998-01-31 17:27  Ulrich Drepper  <drepper@cygnus.com>
2691
2692         * rwlock.c: New file.
2693         * Makefile (libpthread-routines): Add rwlock.
2694         * sysdeps/pthread/pthread.h: Define data structures and declare
2695         functions.
2696         * libpthread.map: Add new functions.
2697
2698 1997-12-18 13:50  Philip Blundell  <pb@nexus.co.uk>
2699
2700         * sysdeps/arm/pt-machine.h: New file; add ARM support.
2701         * sysdeps/arm/Implies: likewise.
2702         * README: Document it.
2703
2704 1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2705
2706         * signals.c: Remove unneeded initializer for sigwaited, saving a
2707         warning.
2708
2709 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2710
2711         * semaphore.c (sem_init): Set sem_spinlock only if available.
2712
2713 1997-12-04 01:48  Ulrich Drepper  <drepper@cygnus.com>
2714
2715         * mutex.c: Implement PTHREAD_MUTEX_CHECKERROR.
2716         * sysdeps/pthread/pthread.h: Define PTHREAD_MUTEX_CHECKERROR.
2717
2718         * Makefile: Update from LinuxThreads 0.7.
2719         * internals.h. Likewise.
2720         * manager.c: Likewise.
2721         * mutex.c: Likewise.
2722         * pthread.c: Likewise.
2723         * signals.c: Likewise.
2724         * specific.c: Likewise.
2725         * Examples/ex3.c: Likewise.
2726
2727 1997-11-20 18:13  Ulrich Drepper  <drepper@cygnus.com>
2728
2729         * pthread.c (__pthread_reset_main_thread): Close pipe only if still
2730         open.
2731
2732 1997-10-29 05:38  Ulrich Drepper  <drepper@cygnus.com>
2733
2734         * wrapsyscall.c: Add socket functions which are also cancelation
2735         points.
2736
2737 1997-10-19 21:40  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
2738
2739         * specific.c (__libc_internal_tsd_set, __libc_internal_tsd_get):
2740         New functions for fast thread specific data within libc.
2741
2742         * internals.h: Add new array p_libc_specific to struct
2743         _pthread_descr_struct.
2744
2745         * sysdeps/pthread/bits/libc-lock.h: Declare new functions.
2746
2747 1997-10-13 05:39  Ulrich Drepper  <drepper@cygnus.com>
2748
2749         * semaphore.h: Add __BEGIN_DECLS/__END_DECLS.
2750         Reported by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
2751
2752 1997-08-29 03:05  Ulrich Drepper  <drepper@cygnus.com>
2753
2754         * internals.h (struct _pthread_descr_struct): Add definitions for
2755         two-level specific key handling.
2756         * manager.c (pthread_handle_create): Initialize specific memory array.
2757         * specific.c: Implement two-level key handling.
2758         * weaks.c: Don't provide dummy key handling.
2759         * sysdeps/pthread/bits/libc-lock.h: Typedef __libc_lock_t (no #define).
2760         Add definition of __libc_key_t.
2761         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define PTHREAD_KEYS_MAX
2762         as 1024.
2763         Add definition of _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
2764         PTHREAD_DESTRUCTOR_ITERATIONS.
2765
2766         * manager.c (pthread_handle_create): Compare mmap result with
2767         MAP_FAILED.
2768
2769         * ptfork.c: Rename to __pthread_atfork and make old name a weak alias.
2770         * sysdeps/pthread/bits/pthread.h: Add prototype for __pthread_atfork.
2771
2772 1997-08-22 19:04  Richard Henderson  <rth@cygnus.com>
2773
2774         sysdeps/sparc -> sysdeps/sparc/sparc32
2775         sysdeps/sparc64 -> sysdeps/sparc/sparc64
2776
2777         * internals.h: Change definition of THREAD_SELF to be an expression,
2778         not a statement that did a return.
2779         * sysdeps/alpha/pt-machine.h (THREAD_SELF): Update accordingly.
2780         * sysdeps/sparc/sparc32/pt-machine.h (THREAD_SELF, INIT_THREAD_SELF):
2781         Follow Solaris and use a "system reserved" register (%g6) to hold
2782         the thread descriptor.
2783         * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
2784
2785 1997-08-03 00:09  Ulrich Drepper  <drepper@cygnus.com>
2786
2787         * mutex.c: Correct pthread_once.  Patch by Xavier Leroy.
2788         * sysdeps/pthread/pthread.h: Add prototype for __pthread_once.
2789         * sysdeps/pthread/bits/pthread.h: Add macros for __libc_once.
2790
2791         * semaphore.c: Include spinlock.h only when needed.
2792
2793         * specific.c (__pthread_setsepcific, __pthread_getspecific): Reject
2794         keys for entries not in use.
2795
2796         * weaks.c: Implement key handling functions for real.
2797
2798 1997-06-29  01:04  Richard Henderson  <richard@gnu.ai.mit.edu>
2799
2800         Initial sparc64-linux support:
2801         * sysdeps/sparc64/Implies: New file.
2802         * sysdeps/sparc64/pt-machine.h: Likewise.
2803
2804 1997-06-29 00:48  Ulrich Drepper  <drepper@cygnus.com>
2805
2806         * semaphore.c: Include spinlock.h at correct place.
2807         Patch by HJ Lu.
2808
2809 1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
2810
2811         The Great Bit File Move:
2812         * sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h.
2813         * sysdeps/powerpc/semaphorebits.h: Likewise.
2814         * sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise.
2815         * sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise.
2816         * sysdeps/pthread/libc-lock.h: -> bits/
2817         * sysdeps/pthread/stdio-lock.h: Likewise.
2818         * sysdeps/unix/sysv/linux/local_lim.h: Likewise.
2819         * sysdeps/unix/sysv/linux/posix_opt.h: Likewise.
2820         * semaphore.h: Likewise.
2821         * sysdeps/pthread/pthread.h: Likewise.
2822
2823         * lockfile.c: <foo.h> -> <bits/foo.h>.
2824         * semaphore.h: Likewise.
2825
2826         * Makefile: (headers): foo.h -> bits/foo.h.
2827         * sysdeps/pthread/Makefile: Likewise.
2828
2829 1997-04-11 01:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
2830
2831         * semaphore.c (sem_init): Set sem_spinlock only if available.
2832
2833         * sysdeps/m68k/pt-machine.h (testandset, __compare_and_swap): Fix
2834         asm constraints.
2835
2836 1997-04-09 03:00  Ulrich Drepper  <drepper@cygnus.com>
2837
2838         Update from LinuxThreads 0.6.
2839
2840         * attr.c (pthread_attr_getdetachstate): Use __sched_get_priority_max
2841         and __sched_get_priority_min instead of names without `__'.
2842
2843         * manager.c: Rewrite large parts to implement opaque pthread_t.
2844
2845         * cancel.c: Adapt for opaque pthread_t type.
2846         * condvar.c: Likewise.
2847         * errno.c: Likewise.
2848         * join.c: Likewise.
2849         * mutex.c: Likewise.
2850         * pthread.c: Likewise.
2851         * signals.c: Likewise.
2852         * specific.c: Likewise.
2853         * restart.h: Likewise.
2854         * queue.h: Likewise.
2855         * Examples/ex3.c: Likewise.
2856         * Examples/ex4.c: Likewise.
2857         * sysdeps/pthread/pthread.h: Likewise.
2858
2859         * pthread.c: Accumulate time for all threads in thread manager.
2860
2861         * semaphore.c: Implement fallback implementation for architectures
2862         sometimes missing compare-exchange operations.
2863
2864         * cancel.c (pthread_cancel): Validate handle argument.
2865         * join.c (pthread_join): Likewise.
2866         (pthread_detach): Likewise.
2867         * signals.c (pthread_kill): Likewise.
2868
2869         * spinlock.h (acquire): Use __sched_yield not sched_yield.
2870
2871         * queue.h (enqueue): Enqueue thread according to priority.
2872
2873         * internals.c (struct pthread_start_args): New struct for passing
2874         args to cloning function.
2875         (struct _pthread): Rename to _pthread_descr_struct and adapt for
2876         opaque pthread_t.
2877
2878         * Examples/Makefile (clean): Pass -f option to rm.
2879
2880         * sysdeps/i386/pt-machine.h: Add check for compare-exchange instruction
2881         and define TEST_FOR_COMPARE_AND_SWAP.
2882         * sysdeps/i386/i486/pt-machine.h: Removed.
2883
2884         * sysdeps/unix/sysv/linux/local_lim.h (PTHREAD_THREADS_MAX): Increase
2885         to 1024.
2886
2887 1997-04-04 16:38  Ulrich Drepper  <drepper@cygnus.com>
2888
2889         * restart.h (suspend): Clear p_signal before suspending.
2890         (suspend_with_cancellation): Likewise.
2891         Patch by Xavier Leroy <Xavier.Leroy@inria.fr>.
2892
2893         * weaks.c: Make __pthread_key_create return 1.
2894         * sysdeps/pthread/libc-lock.h: Define __libc_key_create,
2895         __libc_getspecific, __libc_setspecific, and __libc_key_t.
2896         * sysdeps/pthread/stdio-lock.h: Don't care for implementation not
2897         using libio.
2898
2899 1997-03-19 15:13  Miguel de Icaza  <miguel@nuclecu.unam.mx>
2900
2901         * sysdeps/sparc/pt-machine (RELEASE): Fix.
2902
2903 1997-03-01 07:55  Geoff Keating  <geoffk@ozemail.com.au>
2904
2905         * sysdeps/powerpc/Implies: Added.
2906         * sysdeps/powerpc/pt-machine.h: Added.
2907         * sysdeps/powerpc/semaphorebits.h: Added.
2908
2909 1997-01-22 01:22  Ulrich Drepper  <drepper@cygnus.com>
2910
2911         * pthread.c (__pthread_initial_thread): Correct
2912         initializer.
2913         (__pthread_manager_thread): Likewise.
2914         Reported by Andreas Jaeger.
2915
2916 1997-01-18 22:15  Richard Henderson  <rth@tamu.edu>
2917
2918         Since sigset_t no longer fits in a register, we can't pass in the
2919         thread's initial mask so easily.  Take this opportunity to simplify
2920         the clone implementation by only accepting a single void* argument.
2921
2922         * manager.c (__pthread_manager): Put thread vitals in the thread
2923         struct instead of as arguments through clone.
2924         (pthread_start_thread): Look for them there.
2925         * internals.h (struct _pthread): Add p_initial_fn,
2926         p_initial_fn_arg, p_initial_mask.  Fix __pthread_manager proto.
2927         * pthread.c (pthread_initialize_manager): Revise clone invocation.