dg_pthread_group_destroy(3T) DG/UX R4.11MU05 dg_pthread_group_destroy(3T)
NAME
dgpthreadgroupdestroy - destroy a thread group
SYNOPSIS
#include <pthread.h>
int dgpthreadgroupdestroy(dgpthreadgroupt threadgroup);
where:
threadgroup
Target thread group ID
DESCRIPTION
This function destroys the thread group with thread ID given by
threadgroup. If the thread group does not contain any existing or
undetached threads, the thread group's resources are immediately
cleaned up. Otherwise, the thread group is marked for destruction,
and its resources are freed up when the last thread in the thread
group has exited and all threads in the thread group have been
detached. In any case, new threads may not be created in the thread
group.
If threadgroup denotes the process's initial thread group or a
thread group dedicated to a globally scheduled thread, this function
fails with EINVAL. The initial thread group must be available for
the creation of new threads. Dedicated thread groups are considered
tightly bound to their globally scheduled threads; they are destroyed
when their thread is cleaned up.
If threadgroup denotes a thread group that has already been marked
for destruction, this function fails with ESRCH.
DIAGNOSTICS
Return Value
If successful, dgpthreadgroupdestroy() returns 0. Otherwise, it
returns -1 and sets errno.
Errors
For each of the following conditions, dgpthreadgroupdestroy()
returns -1 and sets errno to the corresponding value:
[ESRCH] The value specified by threadgroup does not refer to a
existing thread group.
[ESRCH] The value specified by threadgroup refers to a thread
group that has already been marked for destruction.
[EINVAL] The value specified by threadgroup refers to the process's
initial thread group or to a thread group that is dedicated
to a globally scheduled thread.
SEE ALSO
dgpthreadgroupcreate(3T), dgpthreadgroupself(3T),
pthreadcreate(3T).
NOTE
All thread groups are cleaned up when the process exits.
Licensed material--property of copyright holder(s)