Rev 3391 | Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3391 | Rev 5056 | ||
---|---|---|---|
Line 90... | Line 90... | ||
90 | static inline int mutex_is_locked(struct mutex *lock) |
90 | static inline int mutex_is_locked(struct mutex *lock) |
91 | { |
91 | { |
92 | return atomic_read(&lock->count) != 1; |
92 | return atomic_read(&lock->count) != 1; |
93 | } |
93 | } |
Line -... | Line 94... | ||
- | 94 | ||
- | 95 | static inline int mutex_trylock(struct mutex *lock) |
|
- | 96 | { |
|
- | 97 | if (likely(atomic_cmpxchg(&lock->count, 1, 0) == 1)) |
|
- | 98 | return 1; |
|
- | 99 | return 0; |
|
- | 100 | } |
|
- | 101 | ||
- | 102 | static inline void mutex_destroy(struct mutex *lock) |
|
- | 103 | { |
|
- | 104 | ||
- | 105 | }; |
|
94 | 106 |