pthread_attr_setdetachstate.txt
来自「Pthread lib库完整说明文档」· 文本 代码 · 共 72 行
TXT
72 行
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 + =
减小字号Ctrl + -
显示快捷键?