请声明出处:http://blog.csdn.net/u012377333/article/details/45499749

Lockable,互斥锁的基类:

/*** An abstract base class for implementing lockable objects* 可以实现锁定对象的抽象基类* @short Abstract interface for lockable objects* @short 可锁定的对象的抽象接口*/
class YATE_API Lockable
{
public:/*** Destructor* 析构函数*/virtual ~Lockable();/*** Attempt to lock the object and eventually wait for it* 试图锁定对象,并最终等待它* @param maxwait Time in microseconds to wait, -1 wait forever* @参数maxwait,时间以微秒为单位等,-1永远等待* @return True if successfully locked, false on failure* @返回true,如果锁定成功,false,失败*/virtual bool lock(long maxwait = -1) = 0;/*** Unlock the object, does never wait* 接触对象锁定,从不等待* @return True if successfully unlocked the object* @返回true, 如果成功解锁*/virtual bool unlock() = 0;/*** Check if the object is currently locked - as it's asynchronous it* guarantees nothing if other thread changes the status* 检查对象目前锁定——它的异步无法保证如果其他线程更改状态* @return True if the object was locked when the function was called* 返回true,如果对象被锁定,当函数被调用*/virtual bool locked() const = 0;/*** Check if the object is unlocked (try to lock and unlock it)* 检查对象是否解锁(尝试加锁或者解锁)* @param maxwait Time in microseconds to wait, -1 to wait forever* @参数maxwait,时间以微秒为单位等,-1永远等待* @return True if successfully locked and unlocked, false on failure* @返回true,如果锁定和解锁成功,false,失败*/virtual bool check(long maxwait = -1);/*** Fully unlock the object, even if it was previously multiple locked.* 完全释放的对象,即使是以前多个锁* There is no guarantee about the object status after the function returns.* 不能保证对象在函数返回后状态。* This function should be used only if you understand it very well* 这个函数仅仅应该在理解的的情况下使用* @return True if the object was fully unlocked* @返回true,如果对象被完全解锁*/virtual bool unlockAll();/*** Set a maximum wait time for debugging purposes* 设置用于调试目的最大的等待时间* @param maxwait Maximum time in microseconds to wait for any lockable*  object when no time limit was requested, zero to disable limit* @参数maxwait, 最长时间以微秒为单位等任何可* 锁定的对象没有时间限制要求时,0 禁用限制*/static void wait(unsigned long maxwait);/*** Get the maximum wait time used for debugging purposes* 获得用于调试目的最大的等待时间* @return Maximum time in microseconds, zero if no maximum is set* @返回微秒最大时间,zero,如果没有设置*/static unsigned long wait();/*** Start actually using lockables, for platforms where these objects are not*  usable in global object constructors.* 开始实际使用可封闭的平台,这些对象是没有* 可用的全局对象构造函数。* This method must be called at least once somewhere from main() but*  before creating any threads and without holding any object locked.* 调用这个方法必须至少一次在从主()但在创建* 任何线程和锁不持有任何对象。*/static void startUsingNow();/*** Enable some safety and sanity check features.* 使一些安全性和完整性检查功能* This provides a safer code and easier locking debugging at the price of performance penalty.* 这提供了一种更安全的代码和更容易锁定调试性能损失为代价的。* This method must be called early and not changed after initialization* 早期必须调用此方法,初始化后没有改变* @param safe True to enable locking safety measures, false to disable* @参数safe,true 启用锁定安全措施,false 禁用*/static void enableSafety(bool safe = true);
};

yate学习--yateclass.h--class YATE_API Lockable相关推荐

  1. yate学习--yateclass.h--class YATE_API Stream

    转载说明: yate中所有基于流操作的基类: /*** Base class for encapsulating system dependent stream capable objects* 封装 ...

  2. yate学习--yateclass.h--class YATE_API Thread : public Runnable

    请声明出处:http://blog.csdn.net/u012377333/article/details/45392379 yate的线程类: /*** A thread is a separate ...

  3. yate学习--yateclass.h--class YATE_API NamedCounter : public String

    请声明出处: NamedCounter,对象命名的计数器: /*** An atomic counter with an associated name* 关联名的原子计数器* @short Atom ...

  4. yate学习--yateclass.h--class YATE_API RefObject : public GenObject

    请声明出处: 对象的引用计数的类,基本大部分的类都继承了该类: /*** A reference counted object.* 引用计数的对象* Whenever using multiple i ...

  5. yate学习--yateclass.h--class YATE_API NamedList : public String

    /*** This class holds a named list of named strings* 这个类保存一个命名字符串的命名字符串链表* @short A named string con ...

  6. yate学习--yatengine.h--class YATE_API MessageReceiver : public GenObject

    请声明出处: MessageReceiver,这个类是一个消息接受的基类: /*** A multiple message receiver to be invoked by a message re ...

  7. x264学习----x264.h结构体

    x264.h结构体学习,还在持续更新中 /****************************************************************************** ...

  8. yate学习--基于CentOS安装运行yate

    基于CentOS安装Yate 1前言 思前想后,很多东西现在理解了,会用了.时间长了,对这个系统进行bug修复的时候.很多知道的东西会忘的差不多,需要重新花比较多的时间去理解和学习.俗话说:好记性不如 ...

  9. 英语知识点整理day16-谚语学习(H字母开头)

    文章目录 谚语学习 H字母开头 谚语学习 H字母开头 1.Habit cures habit. 心病还需心药医 2.Handsome is he who does handsomely. 行为漂亮才算 ...

最新文章

  1. C语言中结构体参数变量的传递
  2. linux fedora14 u盘运行,Win7下Fedora 14 硬盘或U盘安装指南
  3. inverse和Cascade详解
  4. mybatis-通用Mapper
  5. 如果波音公司破产,对美国经济的影响有多大?
  6. 基于CefSharp构建基于Chromium的应用程序
  7. AC算法在美团上单系统的应用
  8. 函数的结束条件和返回值 — return
  9. 《WF编程》系列之23 - 基本活动:IfElseActivity WhileActivity SequenceActivity
  10. Linux桌面上的小动物,前方高能!我的OriginOS桌面上,出现了一群小动物
  11. SCU 4437 Carries(二分乱搞)题解
  12. matlab对数组切片操作
  13. Redis集群和应用——02
  14. 马士兵网络安全大师班薪选课程
  15. 2022保育员(高级)考试模拟100题及在线模拟考试
  16. python+minicap的使用 安卓手机投票到电脑
  17. 基于MATLAB的批量3度带高斯正算(LB--xy)
  18. 单极性归零NRZ码、双极性非归零NRZ码、2ASK、2FSK、2PSK、2DPSK及MATLAB仿真
  19. 股指期货、股指期权与股票有何不同?
  20. 【EM算法】期望最大化算法

热门文章

  1. 首次使用DBISAM,感觉不错!
  2. 微信被加好友过多受限怎么办.
  3. 级联样式表_级联样式表| 第1部分
  4. Windows平台Go语言环境搭建
  5. PUMA学坏了,开始和各大时尚品牌及设计师“联名抢钱“啦
  6. Google Earth Engine(GEE)——如何在线计算NDVI(归一化植被指数)和FVC(植被覆盖度)并批量下载
  7. 【Python数据可视化(七)】使用正确的图表理解数据
  8. 让我们一起来编狼人杀(C++)
  9. 上帝模式,,即God Mode”,或称为“完全控制面板”
  10. linux 注释批处理,关于Linux:bash中的”批处理”文件