提交 e3c48078 编写于 作者: R Ralf Baechle

Define __raw_read_can_lock / __raw_write_can_lock.

Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 f638d197
......@@ -119,6 +119,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
* read-locks.
*/
/*
* read_can_lock - would read_trylock() succeed?
* @lock: the rwlock in question.
*/
#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
/*
* write_can_lock - would write_trylock() succeed?
* @lock: the rwlock in question.
*/
#define __raw_write_can_lock(rw) (!(rw)->lock)
static inline void __raw_read_lock(raw_rwlock_t *rw)
{
unsigned int tmp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册