pthread_mutexattr_setpshared.txt
来自「Pthread lib库完整说明文档」· 文本 代码 · 共 84 行
TXT
84 行
pthread_mutexattr_setpshared SubroutinePurposeSets the value of the processshared attribute of a mutex attributesobject.Note: This subroutine is not implemented in AIX. It always returnsENOSYS.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_mutexattr_setpshared (attr, pshared)pthread_mutexattr_t *attr;int pshared;DescriptionThe pthread_mutexattr_setpshared subroutine sets the value of theprocess-shared attribute of the mutex attributes object attr. Thisattribute specifies the process sharing of the mutex created withthis attributes object.Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersattr Specifies the mutex attributes object.pshared Specifies the process sharing to set. It must have one ofthe following values:PTHREAD_PROCESS_SHARED Specifies that the mutex can be used by anythread that has access to the memory where it is allocated, even ifthese threads belong to different processes.PTHREAD_PROCESS_PRIVATE Specifies that the mutex shall only be usedby threads within the same process as the thread that created it.This is the default value.Return ValuesUpon successful completion, 0 is returned. Otherwise, an error codeis returned.Error CodesThe pthread_mutexattr_setpshared subroutine is unsuccessful if thefollowing is true:EINVAL The attr or pshared parameters are not valid.ENOSYS The process sharing POSIX option is not implemented.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.The implementation of this subroutine is dependent on the processsharing POSIX option. The process sharing POSIX option is not implementedin AIX.Related InformationThe pthread_mutexattr_getpshared subroutine, pthread_mutexattr_initsubroutine, pthread_mutex_init subroutine.Advanced Attributes.Threads Library Options and Threads Library Quick Reference.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?