⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pthread_mutex_init.txt

📁 Pthread lib库完整说明文档
💻 TXT
字号:
pthread_mutex_init SubroutinePurposeInitializes a mutex and sets its attributes.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_mutex_init (mutex, attr)pthread_mutex_t *mutex;pthread_mutexattr_t *attr;DescriptionThe pthread_mutex_init subroutine initializes a new mutex mutex, andsets its attributes according the mutex attributes object attr. Themutex is initially unlocked.After initialization of the mutex, the mutex attributes object canbe reused for another mutex initialization, or deleted.Note:	The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersmutex	Specifies the mutex to be created.attr	Specifes the mutex attributes object to use for initializingthe mutex. If the value is NULL, the default attributes values areused.Return ValuesUpon successful completion, the new mutex is returned via the mutexparameter, and 0 is returned. Otherwise, an error code is returned.Error CodesThe pthread_mutex_init subroutine is unsuccessful if the followingis true:EAGAIN	The system does not have sufficient resources, other than memory,to initialize a new mutex.EBUSY	The mutex mutex is already in use: it was previously createdwith by calling the pthread_mutex_init subroutine, and not destroyedby calling the pthread_mutex_destroy subroutine.EINVAL	The mutex or attr parameters are not valid.ENOMEM	There is not sufficient memory to initialize a new mutex.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.Related InformationThe pthread_mutexattr_init subroutine, pthread_mutexattr_destroy subroutine,pthread_mutex_lock or pthread_mutex_trylock subroutine, pthread_mutex_destroysubroutine, PTHREAD_MUTEX_INITIALIZER macro.Using Mutexes.Threads Library Quick Reference.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -