函数逻辑报告 |
Source Code:kernel\locking\rwsem.c |
Create Date:2022-07-27 10:48:31 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:This function must be called with the sem->wait_lock held to prevent* race conditions between checking the rwsem wait list and setting the* If wstate is WRITER_HANDOFF, it will make sure that either the handoff
函数原型:static inline bool rwsem_try_write_lock(struct rw_semaphore *sem, enum writer_wait_state wstate)
返回类型:bool
参数:
类型 | 参数 | 名称 |
---|---|---|
struct rw_semaphore * | sem | >count accordingly. |
enum writer_wait_state | wstate |
568 | lockdep_assert_held( & wait_lock) |
570 | count等于atomic_long_read( & count) |
571 | 循环 |
572 | has_handoff等于非非count按位与RWSEM_FLAG_HANDOFF的值 |
574 | 如果has_handoff且wstate恒等于 Writer is not first in wait list 则返回:false |
579 | 如果count按位与RWSEM_LOCK_MASK则 |
580 | 如果has_handoff或wstate不等于WRITER_HANDOFF则返回:false |
583 | new或等于RWSEM_FLAG_HANDOFF |
584 | 否则 |
586 | new与等于RWSEM_FLAG_HANDOFF的反 |
588 | 如果链表只有一项则new与等于RWSEM_FLAG_WAITERS的反 |
591 | 当非atomic_long_try_cmpxchg_acquire( & count, & count, new)循环 |
597 | 如果new按位与RWSEM_FLAG_HANDOFF则返回:false |
601 | 返回:true |
名称 | 描述 |
---|---|
rwsem_down_write_slowpath | Wait until we successfully acquire the write lock |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |