mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
Update.
* sysdeps/generic/strstr.c (strstr): Update. New optimized version.
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
2001-12-14 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* man/pthread_atfork.man: Adjust description of mutex handling
|
||||
after fork for current implementation.
|
||||
* linuxthreads.texi: Likewise [PR libc/2519].
|
||||
|
||||
2001-12-13 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* specific.c (pthread_key_delete): Don't contact the thread
|
||||
|
@ -1395,12 +1395,10 @@ pocess image.
|
||||
To understand the purpose of @code{pthread_atfork}, recall that
|
||||
@code{fork} duplicates the whole memory space, including mutexes in
|
||||
their current locking state, but only the calling thread: other threads
|
||||
are not running in the child process. Thus, if a mutex is locked by a
|
||||
thread other than the thread calling @code{fork}, that mutex will remain
|
||||
locked forever in the child process, possibly blocking the execution of
|
||||
the child process. Or if some shared data, such as a linked list, was in the
|
||||
middle of being updated by a thread in the parent process, the child
|
||||
will get a copy of the incompletely updated data which it cannot use.
|
||||
are not running in the child process. The mutexes are not usable after
|
||||
the @code{fork} and must be initialized with @code{pthread_mutex_init}
|
||||
in the child process. This is a limitation of the current
|
||||
implementation and might or might not be present in future versions.
|
||||
|
||||
To avoid this, install handlers with @code{pthread_atfork} as follows: have the
|
||||
@var{prepare} handler lock the mutexes (in locking order), and the
|
||||
@ -1627,4 +1625,3 @@ of a mapping of user threads to kernel threads. It exists for source
|
||||
compatibility. However, it will return the value that was set by the
|
||||
last call to @code{pthread_setconcurrency}.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -30,15 +30,10 @@ while the |parent| and |child| handlers are called in FIFO order
|
||||
To understand the purpose of !pthread_atfork!, recall that !fork!(2)
|
||||
duplicates the whole memory space, including mutexes in their current
|
||||
locking state, but only the calling thread: other threads are not
|
||||
running in the child process. Thus, if a mutex is locked by a thread
|
||||
other than the thread calling !fork!, that mutex will remain locked
|
||||
forever in the child process, possibly blocking the execution of the
|
||||
child process. To avoid this, install handlers with !pthread_atfork!
|
||||
as follows: the |prepare| handler locks the global mutexes (in locking
|
||||
order), and the |parent| and |child| handlers unlock them (in
|
||||
reverse order). Alternatively, |prepare| and |parent| can be set to
|
||||
!NULL! and |child| to a function that calls !pthread_mutex_init! on
|
||||
the global mutexes.
|
||||
running in the child process. The mutexes are not usable after the
|
||||
!fork! and must be initialized with |pthread_mutex_init| in the child
|
||||
process. This is a limitation of the current implementation and might
|
||||
or might not be present in future versions.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
|
||||
|
Reference in New Issue
Block a user