脑子疼是什么原因| 支元体阳性是什么意思| 五月四号什么星座| 熊是什么意思| 赵本山什么学历| 为什么老是胃胀气| 高血压属于什么科| 十八岁是什么年华| 葡萄糖偏低是什么意思| 指甲起层是什么原因| 后背疼痛什么原因| 4是什么生肖| 玻璃的原材料是什么| 怀疑肝不好挂什么科室| 复原乳是什么意思| 朋友梦到我怀孕了是什么意思| 爵迹小说为什么不写了| 月经期间喝什么比较好| 行了是什么意思| 什么是富贵包| 小孩说话晚是什么原因| 早上不晨勃是什么原因| 男性生殖器叫什么| 早上起床头晕是什么原因| 宽带m是什么意思| 八十岁叫什么之年| 晚上一点多是什么时辰| 人格是什么意思| 牛大力和什么泡酒壮阳| 什么东西能加不能减| 用什么泡水喝补肾| 女人梦到火是什么预兆| 血糖高吃什么饭| 对酒当歌是什么生肖| 淋巴结是什么病严重吗| 草酸对人体有什么危害| 口腔白斑是什么病| hospital是什么意思| 翟读什么| 纳粹是什么意思| 依巴斯汀片是什么药| 小孩几天不大便是什么原因怎么办| 一只脚心疼是什么原因| 肚子一直咕咕叫是什么原因| 儿女双全是什么意思| 大便秘结是什么原因| hov是什么意思| 恐惧症吃什么药最好| 慢性宫颈炎用什么药| lf是什么牌子| 高丽棒子是什么意思| 多动症吃什么药| 低密度脂蛋白偏高是什么意思| 腐是什么意思| 女人眼睛干涩吃什么药| 宽宏大度是什么生肖| 姜枣茶什么季节喝最好| 甲木代表什么| egfr是什么| 文化底蕴是什么意思| 可转债是什么| 夏天有什么水果| hcg翻倍慢是什么原因| 钙片什么时候吃最好吸收| 筋膜炎用什么药好| 尿隐血十一是什么意思| 百丽鞋属于什么档次| 三个火字读什么| 薄姬为什么讨厌窦漪房| 膝关节疼是什么原因| 变性淀粉是什么| 蚯蚓靠什么运动| 仙草是什么草| 甲钴胺治疗什么病| 身上长白色的斑点是什么原因| 94年属狗的是什么命| 爱出汗是什么原因女人| tat是什么意思| 闰六月有什么讲究| tasty是什么意思| xanax是什么药| 鼻子上火是什么原因引起的| 外阴溃烂用什么药| 吃什么有助于睡眠效果好| 三月份是什么季节| 右下眼皮跳是什么预兆| 孕妇喝什么牛奶对胎儿好| 坐月子能吃什么水果| 决明子是什么| 什么可以治早泄| 什么牌子的大米好吃| 什么神什么注| 器质性疾病是什么意思| 励精图治是什么意思| 心肌炎有什么症状和表现| 二婚结婚需要什么证件| 拍身份证照片穿什么颜色衣服好看| 举人是什么意思| 水痘是由什么引起的| 趾高气昂是什么意思| 川字属于五行属什么| 二聚体偏高是什么原因| 月经前是什么期| 晚饭吃什么减肥| 第一顺位是什么意思| 幽门螺旋杆菌吃什么药| 准奏是什么意思| 电磁炉上可以放什么锅| 无氧运动是什么意思| 白色的鱼是什么鱼| 染色体异常是什么原因导致的| 喝酒过敏是什么原因| 射手座和什么座最配对| 吃什么降肌酐| 胃酸反酸水吃什么药| 窦性心律不齐吃什么药| 精华液是干什么用的| 微波炉什么牌子好| 健身后应该吃什么| 胸部b超挂什么科| 5月7日是什么星座| 原图是什么意思| 腿膝盖疼是什么原因| 吃什么可以快速排便| 五指毛桃长什么样| 什么人容易老年痴呆| 细胞由什么组成| 一什么河| 检查抑郁症挂什么科| 肾阳虚吃什么中药| 卯是什么生肖| 可拉明又叫什么| 白洞是什么东西| 打完耳洞要注意什么| 53岁属什么| 鸡奸是什么意思| 奶粉结块是什么原因| 无花果有什么营养| 武则天墓为什么不敢挖| 什么是盗汗症状| 银梳子梳头有什么好处和坏处| 右眼皮上长痣代表什么| 皮肤容易晒黑是什么原因| 女人裹脚是从什么时候开始的| 膻味是什么意思| 第三产业是什么| 保肝降酶药首选什么药| 体检应该挂什么科| 灵芝孢子粉治什么病| 孩子走路晚是什么原因| 代沟什么意思| 什么什么的太阳| 怀孕一个月有什么反应| 乳臭未干是什么意思| 游离脂肪酸是什么| 腺瘤型息肉是什么意思| 梦见灵堂是什么预兆| fisherman是什么意思| 什么是潜规则| 扶他林是什么药| 银河系是什么| jdv是什么牌子| 3月25是什么星座| 经常反义词是什么| 海带与什么食物相克| 什么烧鸭子好吃| 缺爱是什么意思| 鹅什么时候开始下蛋| ptc是什么| 重庆市长什么级别| 阿胶补血口服液适合什么人喝| 脊柱侧弯有什么危害| 心火吃什么药| 蛛网膜囊肿是什么病| 什么是阳虚| 天庭的动物是什么生肖| cde是什么意思| 肝火吃什么药| outlets是什么意思| 母公司是什么意思| 清热败火的败是什么意思| 包干价是什么意思| 头晕头疼挂什么科| 鸡犬不宁是什么生肖| 机能鞋是什么意思| 狗为什么吐舌头| 兔子的耳朵像什么| 什么的香味| 吴亦凡为什么叫牛| 尿液检查白细胞高是什么原因| 排便困难是什么原因| 1951年属什么生肖| 腹腔淋巴结肿大是什么原因| 九死一生什么生肖| 腺肌症是什么病| 血色素低吃什么补得快| 一学年是什么意思| 国士无双什么意思| 四月十六是什么星座| 一什么篮子| 相手蟹吃什么| 黄花菜都凉了是什么意思| 琼玖是什么意思| m什么意思| 潦倒是什么意思| 什么发抖| 带子是什么海鲜| 鸡配什么生肖最好| 小孩过敏吃什么药| 吃生葵花籽有什么好处和坏处吗| 鼻窦炎是什么病| 右手背长痣代表什么| 鸡属于什么科| 毛遂自荐什么意思| 滇红茶属于什么茶| 保持器是什么| 大脑记忆力下降是什么原因| 山梨糖醇是什么| 恐龙为什么灭绝| 怀孕药流吃什么药| 什么是传染性软疣| 做亲子鉴定需要什么| 东北属于什么气候| 857什么意思| 儿童口腔溃疡用什么药| 儿童胃炎吃什么药| 肺结节什么东西不能吃| 农历五月的别称是什么| 脚凉是什么原因| 张国立的老婆叫什么名字| 甲状腺球蛋白抗体高是什么原因| 韩愈字什么| 胆汁反流性胃炎吃什么中成药| 女性气血不足吃什么调理| 舌头尖发麻是什么原因| 疤痕憩室什么意思| 医保卡什么样子| 牙疼是什么原因引起的| 精明是什么意思| 女字五行属什么| 蛋白粉什么时候喝效果最好| 金樱子配什么才壮阳| 什么辕什么辙| 动容什么意思| 掉头发是什么原因男性| 吹面不寒杨柳风什么意思| gary是什么意思| 狮子座与什么星座最配| 一段奶粉和二段奶粉有什么区别| aquascutum是什么牌子| 药鱼用什么药效果最好| 栀子花什么时候开| 新西兰现在是什么季节| 母亲节送给妈妈什么礼物| 清宫手术后需要注意什么| 病毒性感染是什么原因| 为什么吐后反而舒服了| 一什么斑点| friday是什么意思| 带节奏是什么意思| 光环是什么意思| 黑怕是什么意思| 膀胱炎吃什么药好得快| 锁骨中间的窝叫什么| 百度
The Open Group Base Specifications Issue 8
IEEE Std 1003.1-2024
Copyright ? 2001-2024 The IEEE and The Open Group

NAME

mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock — lock and unlock a mutex

SYNOPSIS

#include <threads.h>

int mtx_lock(mtx_t *
mtx);
int mtx_timedlock(mtx_t *restrict
mtx,
       const struct timespec *restrict
ts);
int mtx_trylock(mtx_t *
mtx);
int mtx_unlock(mtx_t *
mtx);

DESCRIPTION

[CX] [Option Start] The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1-2024 defers to the ISO C standard. [Option End]

The mtx_lock() function shall block until it locks the mutex pointed to by mtx. If the mutex is non-recursive, the application shall ensure that it is not already locked by the calling thread.

The mtx_timedlock() function shall block until it locks the mutex pointed to by mtx or until after the TIME_UTC-based calendar time pointed to by ts. The application shall ensure that the specified mutex supports timeout. [CX] [Option Start] Under no circumstance shall the function fail with a timeout if the mutex can be locked immediately. The validity of the ts parameter need not be checked if the mutex can be locked immediately. [Option End]

The mtx_trylock() function shall endeavor to lock the mutex pointed to by mtx. If the mutex is already locked (by any thread, including the current thread), the function shall return without blocking. If the mutex is recursive and the mutex is currently owned by the calling thread, the mutex lock count (see below) shall be incremented by one and the mtx_trylock() function shall immediately return success.

[CX] [Option Start] These functions shall not be affected if the calling thread executes a signal handler during the call; if a signal is delivered to a thread waiting for a mutex, upon return from the signal handler the thread shall resume waiting for the mutex as if it was not interrupted. [Option End]

If a call to mtx_lock(), mtx_timedlock() or mtx_trylock() locks the mutex, prior calls to mtx_unlock() on the same mutex shall synchronize with this lock operation.

The mtx_unlock() function shall unlock the mutex pointed to by mtx. The application shall ensure that the mutex pointed to by mtx is locked by the calling thread. [CX] [Option Start]  If there are threads blocked on the mutex object referenced by mtx when mtx_unlock() is called, resulting in the mutex becoming available, the scheduling policy shall determine which thread shall acquire the mutex. [Option End]

A recursive mutex shall maintain the concept of a lock count. When a thread successfully acquires a mutex for the first time, the lock count shall be set to one. Every time a thread relocks this mutex, the lock count shall be incremented by one. Each time the thread unlocks the mutex, the lock count shall be decremented by one. When the lock count reaches zero, the mutex shall become available for other threads to acquire.

For purposes of determining the existence of a data race, mutex lock and unlock operations on mutexes of type mtx_t behave as atomic operations. All lock and unlock operations on a particular mutex occur in some particular total order.

If mtx does not refer to an initialized mutex object, the behavior of these functions is undefined.

RETURN VALUE

The mtx_lock() and mtx_unlock() functions shall return thrd_success on success, or thrd_error if the request could not be honored.

The mtx_timedlock() function shall return thrd_success on success, or thrd_timedout if the time specified was reached without acquiring the requested resource, or thrd_error if the request could not be honored.

The mtx_trylock() function shall return thrd_success on success, or thrd_busy if the resource requested is already in use, or thrd_error if the request could not be honored. The mtx_trylock() function can spuriously fail to lock an unused resource, in which case it shall return thrd_busy.

ERRORS

See RETURN VALUE.


The following sections are informative.

EXAMPLES

None.

APPLICATION USAGE

None.

RATIONALE

These functions are not affected by signal handlers for the reasons stated in XRAT B.2.3 Error Numbers.

Since <pthread.h> has no equivalent of the mtx_timed mutex property, if the <threads.h> interfaces are implemented as a thin wrapper around <pthread.h> interfaces (meaning mtx_t and pthread_mutex_t are the same type), all mutexes support timeout and mtx_timedlock() will not fail for a mutex that was not initialized with mtx_timed. Alternatively, implementations can use a less thin wrapper where mtx_t contains additional properties that are not held in pthread_mutex_t in order to be able to return a failure indication from mtx_timedlock() calls where the mutex was not initialized with mtx_timed.

FUTURE DIRECTIONS

None.

SEE ALSO

mtx_destroy(), timespec_get()

XBD <threads.h>

CHANGE HISTORY

First released in Issue 8. Included for alignment with the ISO/IEC 9899:2018 standard.

End of informative text.

 

return to top of page

UNIX? is a registered Trademark of The Open Group.
POSIX? is a Trademark of The IEEE.
Copyright ? 2001-2024 The IEEE and The Open Group, All Rights Reserved
[ Main Index | XBD | XSH | XCU | XRAT ]

结肠炎吃什么药治疗效果好 闰年是什么 地龙是什么 扩胸运动有什么好处 鹧鸪读音是什么
手心脚心发热吃什么药 体罚是什么意思 带状疱疹后遗神经痛挂什么科 6岁属什么生肖 无名指长痣代表什么
半夜会醒是什么原因 漂亮的近义词是什么 产厄是什么意思 7月份是什么星座 肩周炎口服什么药最好
2003年什么年 鸡飞狗跳是什么生肖 一岁半打什么疫苗 氧化剂是什么 用盐洗脸有什么好处
吃鱼眼睛有什么好处ff14chat.com 金蝉吃什么hcv8jop4ns8r.cn 老公的姐姐叫什么hcv9jop0ns2r.cn 什么牌子的床垫好jinxinzhichuang.com 早上起床手指肿胀是什么原因hcv8jop4ns1r.cn
老打饱嗝是什么原因hcv9jop7ns3r.cn 保泰松是什么药hcv7jop7ns1r.cn 属相兔和什么属相最佳hcv9jop8ns2r.cn dazzling什么意思hcv8jop7ns7r.cn 六安瓜片属于什么茶hcv8jop9ns4r.cn
笏是什么意思hcv9jop2ns2r.cn 尿常规阳性是什么意思hcv8jop0ns6r.cn 一张张什么wuhaiwuya.com 黄褐斑是什么样的图片jiuxinfghf.com 碘酒是什么hcv8jop4ns0r.cn
虎属什么五行sanhestory.com 为什么会得肿瘤hcv9jop3ns5r.cn 痰多吃什么好化痰hcv8jop4ns5r.cn 腿毛旺盛是什么原因hcv9jop4ns9r.cn 丙辰是什么时辰hcv9jop0ns8r.cn
百度