?
? ????? PHP ??? ???? ??? ?? ??
在頭文件<threads.h>中定義 | ||
---|---|---|
int mtx_init(mtx_t * mutex,int type); | (自C11以來(lái)) |
使用type
創(chuàng)建一個(gè)新的互斥對(duì)象,指向的對(duì)象mutex
被設(shè)置為新創(chuàng)建的互斥體的標(biāo)識(shí)符。
type
必須具有以下值之一:
mtx_plain
- 創(chuàng)建一個(gè)簡(jiǎn)單的非遞歸互斥體。
mtx_timed
- 創(chuàng)建支持超時(shí)的非遞歸互斥鎖。
mtx_plain
|
mtx_recursive
- 創(chuàng)建遞歸互斥。
mtx_timed
|
mtx_recursive
- 創(chuàng)建一個(gè)支持超時(shí)的遞歸互斥體。
mutex | - | 指向要初始化的互斥體的指針 |
---|---|---|
type | - | 互斥體的類(lèi)型 |
如果成功則返回 thrd_success,否則返回 thrd_error。
C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):
7.26.4.2 mtx_init 函數(shù)(p:381)
| recursive_timed_mutex 的 C ++文檔 |