Skip to content

Commit

Permalink
Define __raw_read_can_lock / __raw_write_can_lock.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent f638d19 commit e3c4807
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/asm-mips/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e3c4807

Please sign in to comment.