|
SimpleKernel 1.17.0
|
RAII 风格的锁守卫模板类 More...
#include <spinlock.hpp>

Public Types | |
| using | mutex_type = Mutex |
Public Member Functions | |
构造/析构函数 | |
| LockGuard (mutex_type &mutex) | |
| 构造函数,自动获取锁 | |
| ~LockGuard () | |
| 析构函数,自动释放锁 | |
| LockGuard ()=delete | |
| LockGuard (const LockGuard &)=delete | |
| LockGuard (LockGuard &&)=delete | |
| auto | operator= (const LockGuard &) -> LockGuard &=delete |
| auto | operator= (LockGuard &&) -> LockGuard &=delete |
Private Attributes | |
| mutex_type & | mutex_ |
RAII 风格的锁守卫模板类
| Mutex | 锁类型,必须有返回 Expected<void> 的 Lock() 和 UnLock() 方法 |
Definition at line 131 of file spinlock.hpp.
Definition at line 133 of file spinlock.hpp.
|
inlineexplicit |
构造函数,自动获取锁
| mutex | 要保护的锁对象 |
Definition at line 142 of file spinlock.hpp.

析构函数,自动释放锁
Definition at line 178 of file spinlock.hpp.

|
delete |
|
delete |
|
delete |
|
private |
Definition at line 219 of file spinlock.hpp.