diff options
Diffstat (limited to 'pthread')
-rw-r--r-- | pthread/pt-create.c | 1 | ||||
-rw-r--r-- | pthread/pt-exit.c | 8 | ||||
-rw-r--r-- | pthread/pt-internal.h | 6 |
3 files changed, 4 insertions, 11 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 99d1b47..5358b08 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -217,7 +217,6 @@ __pthread_create_internal (struct __pthread **thread, pthread->tcb = NULL; failed_thread_tls_alloc: #endif /* ENABLE_TLS */ - __pthread_thread_dealloc (pthread); __pthread_thread_terminate (pthread); /* __pthread_thread_terminate has taken care of deallocating the stack and diff --git a/pthread/pt-exit.c b/pthread/pt-exit.c index ea61732..6d827db 100644 --- a/pthread/pt-exit.c +++ b/pthread/pt-exit.c @@ -98,15 +98,11 @@ __pthread_exit (void *status) /* Destroy any signal state. */ __pthread_sigstate_destroy (self); - /* Kernel resources may be used to implement synchronization objects, - release them late. */ - __pthread_thread_dealloc (self); - /* Self terminating requires TLS, so defer the release of the TCB until the thread structure is reused. */ - /* Terminate the kernel thread, release the stack and drop the - self reference. */ + /* Release kernel resources, including the kernel thread and the stack, + and drop the self reference. */ __pthread_thread_terminate (self); /* NOTREACHED */ diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 9747f1f..7465761 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -245,14 +245,12 @@ extern int __pthread_setup (struct __pthread *__restrict thread, resources) for THREAD; it must not be placed on the run queue. */ extern int __pthread_thread_alloc (struct __pthread *thread); -/* Deallocate any kernel resources associated with THREAD. */ -extern void __pthread_thread_dealloc (struct __pthread *thread); - /* Start THREAD making it eligible to run. */ extern int __pthread_thread_start (struct __pthread *thread); /* Terminate the kernel thread associated with THREAD, and deallocate its - stack. In addition, THREAD loses one reference. + stack as well as any other kernel resource associated with it. + In addition, THREAD looses one reference. This function can be called by any thread, including the target thread. Since some resources that are destroyed along the kernel thread are |