mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
2003-07-07 Ulrich Drepper <drepper@redhat.com> * descr.h (struct pthread): Add pid field. * allocatestack.c (allocate_stack): Initialize pid field in descriptor. (__reclaim_stacks): Likewise. * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined also check for PID of the signal source. (__pthread_initialize_minimal_internal): Also initialize pid field of initial thread's descriptor. * pthread_cancel.c: Use tgkill instead of tkill if possible. * sysdeps/unix/sysv/linux/fork.c: Likewise. * sysdeps/unix/sysv/linux/pt-raise.c: Likewise. * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise. * sysdeps/unix/sysv/linux/raise.c: Likewise.
This commit is contained in:
@ -332,6 +332,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
|
||||
pd->header.sysinfo = THREAD_GETMEM (THREAD_SELF, header.sysinfo);
|
||||
#endif
|
||||
|
||||
/* The process ID is also the same as that of the caller. */
|
||||
pd->pid = THREAD_GETMEM (THREAD_SELF, pid);
|
||||
|
||||
/* Allocate the DTV for this thread. */
|
||||
if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
|
||||
/* Something went wrong. */
|
||||
@ -464,6 +467,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
|
||||
pd->header.sysinfo = THREAD_GETMEM (THREAD_SELF, header.sysinfo);
|
||||
#endif
|
||||
|
||||
/* The process ID is also the same as that of the caller. */
|
||||
pd->pid = THREAD_GETMEM (THREAD_SELF, pid);
|
||||
|
||||
/* Allocate the DTV for this thread. */
|
||||
if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
|
||||
{
|
||||
@ -626,6 +632,9 @@ __reclaim_stacks (void)
|
||||
/* This marks the stack as free. */
|
||||
curp->tid = 0;
|
||||
|
||||
/* The PID field must be initialized for the new process. */
|
||||
curp->pid = self->pid;
|
||||
|
||||
/* Account for the size of the stack. */
|
||||
stack_cache_actsize += curp->stackblock_size;
|
||||
}
|
||||
|
Reference in New Issue
Block a user