Manual Pages for Linux CentOS command on man pthread_attr_getdetachstate
MyWebUniversity

Manual Pages for Linux CentOS command on man pthread_attr_getdetachstate

PTHREADATTRSETDETACHSTATELinux Programmer's MaPTHREADATTRSETDETACHSTATE(3)

NAME

pthreadattrsetdetachstate, pthreadattrgetdetachstate - set/get detach state attribute in thread attributes object SYNOPSIS

#include int pthreadattrsetdetachstate(pthreadattrt *attr, int detachstate); int pthreadattrgetdetachstate(pthreadattrt *attr, int *detachstate);

Compile and link with -pthread. DESCRIPTION The pthreadattrsetdetachstate() function sets the detach state attribute of the thread attributes object referred to by attr to the value specified in detachstate. The detach state attribute determines whether a thread created using the thread attributes object attr will be created in a joinable or a detached state. The following values may be specified in detachstate: PTHREADCREATEDETACHED Threads that are created using attr will be created in a detached state. PTHREADCREATEJOINABLE Threads that are created using attr will be created in a join‐ able state. The default setting of the detach state attribute in a newly initial‐ ized thread attributes object is PTHREADCREATEJOINABLE. The pthreadattrgetdetachstate() returns the detach state attribute of the thread attributes object attr in the buffer pointed to by detach‐ state. RETURN VALUE On success, these functions return 0; on error, they return a nonzero error number. ERRORS pthreadattrsetdetachstate() can fail with the following error: EINVAL An invalid value was specified in detachstate. ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌───────────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├───────────────────────────────┼───────────────┼─────────┤

│pthreadattrsetdetachstate(), │ Thread safety │ MT-Safe │ │pthreadattrgetdetachstate() │ │ │ └───────────────────────────────┴───────────────┴─────────┘ CONFORMING TO

POSIX.1-2001. NOTES See pthreadcreate(3) for more details on detached and joinable threads. A thread that is created in a joinable state should eventually either be joined using pthreadjoin(3) or detached using pthreaddetach(3); see pthreadcreate(3). It is an error to specify the thread ID of a thread that was created in a detached state in a later call to pthreaddetach(3) or pthreadjoin(3). EXAMPLE See pthreadattrinit(3). SEE ALSO pthreadattrinit(3), pthreadcreate(3), pthreaddetach(3), pthreadjoin(3), pthreads(7) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2010-02-03 PTHREADATTRSETDETACHSTATE(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™