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