int __sched mutex_lock_killable(struct mutex *lock) { int ret; might_sleep(); ret = __mutex_fastpath_lock_retval (&lock->count, __mutex_lock_killable_slowpath); if (!ret) mutex_set_owner(lock); return ret; }
/*** * mutex_lock_interruptible - acquire the mutex, interruptable * @lock: the mutex to be acquired * * Lock the mutex like mutex_lock(), and return 0 if the mutex has * been acquired or sleep until the mutex becomes available. If a * signal arrives while waiting for the lock then this function * returns -EINTR. * * This function is similar to (but not equivalent to) down_interruptible(). */ int fastcall __sched mutex_lock_interruptible(struct mutex *lock) { might_sleep(); return __mutex_fastpath_lock_retval (&lock->count, __mutex_lock_interruptible_slowpath); }
int __sched mutex_lock_killable(struct mutex *lock) { might_sleep(); return __mutex_fastpath_lock_retval (&lock->count, __mutex_lock_killable_slowpath); }
/*** * mutex_lock_interruptible - acquire the mutex, interruptable * @lock: the mutex to be acquired * * Lock the mutex like mutex_lock(), and return 0 if the mutex has * been acquired or sleep until the mutex becomes available. If a * signal arrives while waiting for the lock then this function * returns -EINTR. * * This function is similar to (but not equivalent to) down_interruptible(). */ int mutex_lock_interruptible(struct mutex *lock) { return __mutex_fastpath_lock_retval (&lock->count, __mutex_lock_interruptible_slowpath); }