mtx_init
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   定义于头文件  <threads.h>
  | 
||
|   int mtx_init( mtx_t* mutex, int type );  | 
(C11 起) | |
创建新的拥有 type 类型的互斥。设置 mutex 所指向的对象为新创建互斥的标识符。
type 必须拥有下列值之一:
- mtx_plain - 创建简单的,非递归互斥。
 - mtx_timed - 创建非递归的,支持时间限制的互斥。
 - mtx_plain | mtx_recursive - 创建递归互斥。
 - mtx_timed | mtx_recursive - 创建递归的支持时限的互斥。
 
参数
| mutex | - | 指向要初始化的互斥的指针 | 
| type | - | 互斥的类型 | 
返回值
若成功则为 thrd_success ,否则为 thrd_error 。
引用
- C11 standard (ISO/IEC 9899:2011):
 
- 7.26.4.2 The mtx_init function (p: 381)