diff options
Diffstat (limited to 'include/linux/mutex.h')
-rw-r--r-- | include/linux/mutex.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f363bc8fdc74..9f3199571994 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -126,6 +126,15 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
126 | return atomic_read(&lock->count) != 1; | 126 | return atomic_read(&lock->count) != 1; |
127 | } | 127 | } |
128 | 128 | ||
129 | /* return non-zero to abort. only pre-side-effects may abort */ | ||
130 | typedef int (*side_effect_t)(unsigned long); | ||
131 | extern void mutex_lock_sfx(struct mutex *lock, | ||
132 | side_effect_t pre, unsigned long pre_arg, | ||
133 | side_effect_t post, unsigned long post_arg); | ||
134 | extern void mutex_unlock_sfx(struct mutex *lock, | ||
135 | side_effect_t pre, unsigned long pre_arg, | ||
136 | side_effect_t post, unsigned long post_arg); | ||
137 | |||
129 | /* | 138 | /* |
130 | * See kernel/mutex.c for detailed documentation of these APIs. | 139 | * See kernel/mutex.c for detailed documentation of these APIs. |
131 | * Also see Documentation/mutex-design.txt. | 140 | * Also see Documentation/mutex-design.txt. |
@@ -145,6 +154,7 @@ extern void mutex_lock(struct mutex *lock); | |||
145 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); | 154 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); |
146 | extern int __must_check mutex_lock_killable(struct mutex *lock); | 155 | extern int __must_check mutex_lock_killable(struct mutex *lock); |
147 | 156 | ||
157 | |||
148 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 158 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
149 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 159 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
150 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) | 160 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) |