mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 13:51:52 +00:00
[PATCH] add sem_is_read/write_locked()
Add sem_is_read/write_locked functions to the read/write semaphores, along the same lines of the *_is_locked spinlock functions. The swap token tuning patch uses sem_is_read_locked; sem_is_write_locked is added for completeness. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
63f324cf07
commit
eb92f4ef32
10 changed files with 50 additions and 0 deletions
|
@ -61,5 +61,10 @@ extern void FASTCALL(__up_read(struct rw_semaphore *sem));
|
|||
extern void FASTCALL(__up_write(struct rw_semaphore *sem));
|
||||
extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem));
|
||||
|
||||
static inline int rwsem_is_locked(struct rw_semaphore *sem)
|
||||
{
|
||||
return (sem->activity != 0);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_RWSEM_SPINLOCK_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue