?? pthread_setspecific.txt
字號:
pthread_setspecific SubroutinePurposeSets the thread-specific data associated with a specified key.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_setspecific (key, value)pthread_key_t key;const void *value;DescriptionThe pthread_setspecific subroutine sets the thread-specific data associatedwith the key key. It is a void pointer.Typically, thread-specific data are pointers to dynamically allocatedstorage. When freeing the storage, the value should be set to NULL.It is not recommended to cast this pointer into scalar data type (intfor example), because the casts may not be portable, and because thevalue of NULL is implementation-dependent.Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parameterskey Specifies the key to which the value is bound.value Specifies the new thread-specific value.Return ValuesUpon successful completion, 0 is returned. Otherwise, an error codeis returned.Error CodesThe pthread_setspecific subroutine is unsuccessful if the followingis true:EINVAL The key parameter is not valid.ENOMEM There is not sufficient memory to associate the value withthe key.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.Related InformationThe pthread_key_create subroutine, pthread_getspecific subroutine.Thread-Specific Data.Threads Library Quick Reference.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -