1MUTEX_LOCK(9)                 Mutex API reference                MUTEX_LOCK(9)
2
3
4

NAME

6       mutex_lock - acquire the mutex
7

SYNOPSIS

9       void __sched mutex_lock(struct mutex * lock);
10

ARGUMENTS

12       lock
13           the mutex to be acquired
14

DESCRIPTION

16       Lock the mutex exclusively for this task. If the mutex is not available
17       right now, it will sleep until it can get it.
18
19       The mutex must later on be released by the same task that acquired it.
20       Recursive locking is not allowed. The task may not exit without first
21       unlocking the mutex. Also, kernel memory where the mutex resides mutex
22       must not be freed with the mutex still locked. The mutex must first be
23       initialized (or statically defined) before it can be locked.
24       memset-ing the mutex to 0 is not allowed.
25
26       ( The CONFIG_DEBUG_MUTEXES .config option turns on debugging checks
27       that will enforce the restrictions and will also do deadlock debugging.
28       )
29
30       This function is similar to (but not equivalent to) down.
31

AUTHOR

33       Rusty Russell <rusty@rustcorp.com.au>
34           Author.
35
37Kernel Hackers Manual 3.10         June 2019                     MUTEX_LOCK(9)
Impressum