English Chinese (Simplified) (zh_CN)
A list of data structures or data structure members that this entry protects. For data structure members, the name will be in the form of `structure name`.`member name`.
A mutex is simply a lock used to guarantee mutual exclusion. Specifically, a mutex may only be owned by one entity at a time. If another entity wishes to obtain a mutex that is already owned, it must wait until the mutex is released. In the FreeBSD kernel, mutexes are owned by processes. Mutex就是一种用来解决共享/排它矛盾的锁。 一个mutex在一个时刻只可以被一个实体拥有。如果另一个实体要获得已经被拥有的mutex, 就会进入等待,直到这个mutex被释放。在FreeBSD内核中,mutex被进程所拥有。
A sleep mutex 一个睡眠 mutex
A spin mutex 一个循环 mutex
An atomically protected variable is a special variable that is not protected by an explicit lock. Instead, all data accesses to the variables use special atomic operations as described in man:atomic[9]. Very few variables are treated this way, although other synchronization primitives such as mutexes are implemented with atomically protected variables.
Atomically Protected Variables 原子保护变量
Chapter 2. Locking Notes
Dependent Functions 依赖函数
Each mutex has several properties of interest: 每个mutex有几个令人感兴趣的属性:
Functions that can only be called if this mutex is held. 仅当mutex被持有时才可以被调用的函数。
Locking Notes 内核中的锁
Logical Name 逻辑名
Mutex List Mutex列表
Mutexes Mutex
Mutexes may be recursively acquired, but they are intended to be held for a short period of time. Specifically, one may not sleep while holding a mutex. If you need to hold a lock across a sleep, use a man:lockmgr[9] lock.
Protectees 保护对象
Shared Exclusive Lock List 共享互斥锁列表
Shared Exclusive Locks 共享互斥锁
The name of the mutex assigned to it by `mtx_init`. This name is displayed in KTR trace messages and witness errors and warnings and is used to distinguish mutexes in the witness code.
The name of the struct mtx variable in the kernel source.