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