Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38201
b: refs/heads/master
c: fac99d9
h: refs/heads/master
i:
  38199: e6ec130
v: v3
  • Loading branch information
Paul Mundt committed Oct 3, 2006
1 parent 964bb9f commit 717ebfb
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 2914d4da172f53f71d0563d3c3bae14e496cbc86
refs/heads/master: fac99d97469e7f91102f97101bea620e5f073196
9 changes: 8 additions & 1 deletion trunk/include/asm-sh/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
__raw_spin_unlock(&rw->lock);
}

#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
static inline int __raw_read_trylock(raw_rwlock_t *lock)
{
atomic_t *count = (atomic_t*)lock;
if (atomic_dec_return(count) >= 0)
return 1;
atomic_inc(count);
return 0;
}

static inline int __raw_write_trylock(raw_rwlock_t *rw)
{
Expand Down

0 comments on commit 717ebfb

Please sign in to comment.