📄 pthread_attr_setdetachstate.txt
字号:
pthread_attr_setdetachstate SubroutinePurposeSets the value of the detachstate attribute of a thread attributesobject.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_attr_setdetachstate (attr, detachstate)pthread_attr_t *attr;int detachstate;DescriptionThe pthread_attr_setdetachstate subroutine sets the value of the detachstateattribute of the thread attributes object attr. This attribute specifiesthe detached state of a thread created with this attributes object.Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersattr Specifies the thread attributes object.detachstate Specifies the detached state to set. It must have oneof the following values:PTHREAD_CREATE_DETACHED Specifies that the thread will be createdin detached state. This is the default value.PTHREAD_CREATE_UNDETACHED Specifies that the thread will be createdin undetached state.Return ValuesUpon successful completion, 0 is returned. Otherwise, an error codeis returned.Error CodesThe pthread_attr_setdetachstate subroutine is unsuccessful if thefollowing is true:EINVAL The attr or detachstate parameters are not valid.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.Related InformationThe pthread_attr_getdetachstate subroutine, pthread_attr_init subroutine,pthread_create subroutine.Creating Threads.Threads Library Quick Reference.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -