Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24823
b: refs/heads/master
c: bc8846c
h: refs/heads/master
i:
  24821: d17878a
  24819: a7a4066
  24815: b6573a1
v: v3
  • Loading branch information
Kyle McMartin authored and Kyle McMartin committed Mar 30, 2006
1 parent 9599039 commit 8de0fbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 102c8c76f787add0790406d5c47e03cb6f8765c2
refs/heads/master: bc8846c522264d2522b0082321ec8c2051a4536f
16 changes: 12 additions & 4 deletions trunk/include/asm-parisc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,22 @@ static __inline__ int __raw_write_trylock(raw_rwlock_t *rw)
return 1;
}

static __inline__ int __raw_is_read_locked(raw_rwlock_t *rw)
/*
* read_can_lock - would read_trylock() succeed?
* @lock: the rwlock in question.
*/
static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw)
{
return rw->counter > 0;
return rw->counter >= 0;
}

static __inline__ int __raw_is_write_locked(raw_rwlock_t *rw)
/*
* write_can_lock - would write_trylock() succeed?
* @lock: the rwlock in question.
*/
static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw)
{
return rw->counter < 0;
return !rw->counter;
}

#endif /* __ASM_SPINLOCK_H */

0 comments on commit 8de0fbf

Please sign in to comment.