Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15083
b: refs/heads/master
c: bf7ecec
h: refs/heads/master
i:
  15081: 5857f6b
  15079: 5161824
v: v3
  • Loading branch information
Keith Owens authored and Tony Luck committed Dec 12, 2005
1 parent 60cdd8e commit d84b8c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: f64fa6772aa874e5cad02a9d87e6b0d99ced3d48
refs/heads/master: bf7ececa9b68f4720f1ce344f442435660bcdae7
12 changes: 11 additions & 1 deletion trunk/include/asm-ia64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ static inline void __raw_write_unlock(raw_rwlock_t *x)

#endif /* !ASM_SUPPORTED */

#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
static inline int __raw_read_trylock(raw_rwlock_t *x)
{
union {
raw_rwlock_t lock;
__u32 word;
} old, new;
old.lock = new.lock = *x;
old.lock.write_lock = new.lock.write_lock = 0;
++new.lock.read_counter;
return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
}

#endif /* _ASM_IA64_SPINLOCK_H */

0 comments on commit d84b8c4

Please sign in to comment.