C++ 概念: BasicLockable
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
BasicLockable
概念描述了最小的特点,类型,提供独家阻塞语义执行代理(即线程).原文:
The
BasicLockable
concept describes the minimal characteristics of types that provide exclusive blocking semantics for execution agents (i.e. threads).[编辑] 要求
对于类型
L
BasicLockable
,必须满足下列条件的对象m
类型L
原文:
For type
L
to be BasicLockable
, the following conditions have to be satisfied for an object m
of type L
:Expression | Requires | Effects |
---|---|---|
m.lock() | Blocks until a lock can be obtained for the current execution agent. If an exception is thrown, no lock is obtained. | |
m.unlock() | The current execution agent should hold the lock m .
|
Releases the lock held by the execution agent. Throws no exceptions. |